diff --git a/config/Wallpaper.nix b/config/Wallpaper.nix index 08ecea5..678b551 100644 --- a/config/Wallpaper.nix +++ b/config/Wallpaper.nix @@ -1,13 +1,13 @@ -{ config, lib, pkgs, ... }: let +{ config, pkgs, ... }: +let cfg = config.module.wallpaper; -in { - config = lib.mkMerge [ - (lib.mkIf cfg.video { - environment.systemPackages = [ - (pkgs.writeShellScriptBin "wallpaper-video" '' - mpvpaper -o 'no-audio --loop-file --panscan=1' '*' ${cfg.videoPath} - '') - ]; - }) - ]; +in +{ + config = { + environment.systemPackages = [ + (pkgs.writeShellScriptBin "wallpaper-video" '' + mpvpaper -o 'no-audio --loop-file --panscan=1' '*' ${cfg.videoPath} + '') + ]; + }; } diff --git a/home/file/sway/module/Style.conf b/home/file/sway/module/Style.conf index 15a5904..d757390 100644 --- a/home/file/sway/module/Style.conf +++ b/home/file/sway/module/Style.conf @@ -1,4 +1,6 @@ output * bg @wallpaper@ fill +bindsym --to-code $mod+z exec swayscript wallpaper_video + client.focused "#@accent@" "#@accent@" "#@fg@" "#@accent@" "#@accent@" client.focused_inactive "#@border@" "#@border@" "#@fg@" "#@border@" "#@border@" client.unfocused "#@border@" "#@border@" "#@fg@" "#@border@" "#@border@" diff --git a/package/swayscript/script/Wallpaper.sh b/package/swayscript/script/Wallpaper.sh new file mode 100644 index 0000000..e50c6db --- /dev/null +++ b/package/swayscript/script/Wallpaper.sh @@ -0,0 +1,4 @@ +# Toggle video wallpaper. +function wallpaper_video() { + pkill mpvpaper || wallpaper-video +}