From 703ce5303c120743e89ada96bd721bc2d4d99f11 Mon Sep 17 00:00:00 2001 From: Dmitry Voronin Date: Mon, 6 Jan 2025 18:45:32 +0300 Subject: [PATCH] Swayscript: Fix wallpaper_video reloads. --- config/Wallpaper.nix | 2 +- home/file/sway/module/Style.conf | 2 +- package/swayscript/script/Wallpaper.sh | 6 +++++- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/config/Wallpaper.nix b/config/Wallpaper.nix index 607c2ae..f037157 100644 --- a/config/Wallpaper.nix +++ b/config/Wallpaper.nix @@ -12,7 +12,7 @@ in (lib.mkIf (cfg.videoPath != null) { environment.systemPackages = [ (pkgs.writeShellScriptBin "wallpaper-video" '' - mpvpaper -o 'no-audio --hwdec=auto --loop-file --panscan=1' '*' ${cfg.videoPath} + mpvpaper -o 'no-audio --hwdec=auto --loop-file --panscan=1' '*' ${cfg.videoPath} & disown '') ]; }) diff --git a/home/file/sway/module/Style.conf b/home/file/sway/module/Style.conf index d757390..d9808e9 100644 --- a/home/file/sway/module/Style.conf +++ b/home/file/sway/module/Style.conf @@ -1,5 +1,5 @@ output * bg @wallpaper@ fill -bindsym --to-code $mod+z exec swayscript wallpaper_video +bindsym --to-code $mod+z exec 'swayscript wallpaper_video' client.focused "#@accent@" "#@accent@" "#@fg@" "#@accent@" "#@accent@" client.focused_inactive "#@border@" "#@border@" "#@fg@" "#@border@" "#@border@" diff --git a/package/swayscript/script/Wallpaper.sh b/package/swayscript/script/Wallpaper.sh index 37fbef7..a1c8849 100644 --- a/package/swayscript/script/Wallpaper.sh +++ b/package/swayscript/script/Wallpaper.sh @@ -1,5 +1,9 @@ # Toggle video wallpaper. function wallpaper_video() { notify_short - pkill mpvpaper || wallpaper-video + re() { + pkill mpvpaper || wallpaper-video + } + + _sway_iterate_sockets re }