Swayscript: Fix wallpaper_video reloads.

This commit is contained in:
Dmitry Voronin 2025-01-06 18:45:32 +03:00
parent 163a7c973b
commit 703ce5303c
Signed by: voronind
SSH key fingerprint: SHA256:3kBb4iV2ahufEBNq+vFbUe4QYfHt98DHQjN7QaptY9k
3 changed files with 7 additions and 3 deletions

View file

@ -12,7 +12,7 @@ in
(lib.mkIf (cfg.videoPath != null) { (lib.mkIf (cfg.videoPath != null) {
environment.systemPackages = [ environment.systemPackages = [
(pkgs.writeShellScriptBin "wallpaper-video" '' (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
'') '')
]; ];
}) })

View file

@ -1,5 +1,5 @@
output * bg @wallpaper@ fill 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 "#@accent@" "#@accent@" "#@fg@" "#@accent@" "#@accent@"
client.focused_inactive "#@border@" "#@border@" "#@fg@" "#@border@" "#@border@" client.focused_inactive "#@border@" "#@border@" "#@fg@" "#@border@" "#@border@"

View file

@ -1,5 +1,9 @@
# Toggle video wallpaper. # Toggle video wallpaper.
function wallpaper_video() { function wallpaper_video() {
notify_short notify_short
re() {
pkill mpvpaper || wallpaper-video pkill mpvpaper || wallpaper-video
}
_sway_iterate_sockets re
} }