mirror of
https://github.com/anufrievroman/waypaper.git
synced 2024-11-22 07:22:19 +03:00
Add hyprpaper backend support
This commit is contained in:
parent
8b197a7141
commit
e0a432daf3
@ -84,6 +84,21 @@ def change_wallpaper(image_path, cf, monitor, txt):
|
||||
subprocess.Popen(["setwallpaper", "--mode", fill, image_path])
|
||||
print(f"{txt.msg_setwith} {cf.backend}")
|
||||
|
||||
# hyprpaper backend:
|
||||
elif cf.backend == "hyprpaper":
|
||||
try:
|
||||
subprocess.Popen(["hyprpaper"])
|
||||
time.sleep(0.01)
|
||||
except Exception as e:
|
||||
print(f"{txt.err_kill} {e}")
|
||||
preload_command = ["hyprctl", "hyprpaper", "preload", image_path]
|
||||
if monitor == "All":
|
||||
monitor = ""
|
||||
wallpaper_command = ["hyprctl", "hyprpaper", "wallpaper", f"{monitor},{image_path}"]
|
||||
subprocess.Popen(preload_command)
|
||||
subprocess.Popen(wallpaper_command)
|
||||
|
||||
|
||||
elif cf.backend == "none":
|
||||
pass
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
BACKEND_OPTIONS = ["none", "swaybg", "swww", "feh", "wallutils"]
|
||||
BACKEND_OPTIONS = ["none", "swaybg", "swww", "feh", "wallutils", "hyprpaper"]
|
||||
FILL_OPTIONS = ["fill", "stretch", "fit", "center", "tile"]
|
||||
SORT_OPTIONS = ["name", "namerev", "date", "daterev"]
|
||||
SORT_DISPLAYS = {
|
||||
@ -12,6 +12,7 @@ IMAGE_EXTENSIONS = {
|
||||
BACKEND_OPTIONS[1]: ['.gif', '.jpg', '.jpeg', '.png', '.webp', '.bmp', '.pnm', '.tiff'],
|
||||
BACKEND_OPTIONS[2]: ['.gif', '.jpg', '.jpeg', '.png', '.bmp', '.pnm', '.tiff'],
|
||||
BACKEND_OPTIONS[3]: ['.gif', '.jpg', '.jpeg', '.png'],
|
||||
BACKEND_OPTIONS[5]: ['.jpg', '.jpeg', '.png', '.webp'],
|
||||
}
|
||||
|
||||
SWWW_TRANSITION_TYPES = ["any", "none", "simple", "fade", "wipe", "left", "right", "top",
|
||||
|
Loading…
Reference in New Issue
Block a user