Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions pokemonterminal/wallpaper/adapters/hyprland.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
from os import environ
from subprocess import run, DEVNULL
from . import WallpaperProvider as _WProv
from shutil import which

class HyprlandProvider(_WProv):
def change_wallpaper(path: str):
run(["hyprctl", "hyprpaper", "preload", path], stdout=DEVNULL, check=True)

run(["hyprctl", "hyprpaper", "wallpaper", ","+path], stdout=DEVNULL, check=True)

def is_compatible() -> bool:
tools_available = which("hyprctl") is not None and which("hyprpaper") is not None
de_is_hypr = "hyprland" in environ.get("XDG_CURRENT_DESKTOP", default='').lower()

return tools_available and de_is_hypr

def __str__():
return "Hyprland wallpaper support"