diff --git a/.scripts/switch-wallpaper.sh b/.scripts/switch-wallpaper.sh deleted file mode 100644 index 3812fc0..0000000 --- a/.scripts/switch-wallpaper.sh +++ /dev/null @@ -1,10 +0,0 @@ -# -n tells `wal` to skip setting the wallpaper. -wal -i ~/Wallpapers/ -n - -# Using feh to tile the wallpaper now. -# We grab the wallpaper location from wal's cache so -# that this works even when a directory is passed. -swww img "$(<"${HOME}/.cache/wal/wal")" --transition-type wipe --transition-angle 45 --transition-fps 90 - -# Copy cava and update config -cp ~/.cache/wal/cava-config ~/.config/cava/config && pkill -USR2 cava diff --git a/home-manager/terminal.nix b/home-manager/terminal.nix index 3bd5345..708d23d 100644 --- a/home-manager/terminal.nix +++ b/home-manager/terminal.nix @@ -30,7 +30,6 @@ clean = "nix-store --gc"; dotfiles = "cd ~/dotfiles/"; nv = "nvim"; - pywal = "bash ~/dotfiles/.scripts/switch-wallpaper.sh"; }; oh-my-zsh = { @@ -65,5 +64,17 @@ home.packages = with pkgs; [ neofetch (nerdfonts.override { fonts = [ "JetBrainsMono" ]; }) + (pkgs.writeShellScriptBin "pywal" '' + # -n tells `wal` to skip setting the wallpaper. + wal -i ~/Wallpapers/ -n + + # Using feh to tile the wallpaper now. + # We grab the wallpaper location from wal's cache so + # that this works even when a directory is passed. + swww img "$(<"${config.home.homeDirectory}/.cache/wal/wal")" --transition-type wipe --transition-angle 45 --transition-fps 90 + + # Copy cava and update config + cp ~/.cache/wal/cava-config ~/.config/cava/config && pkill -USR2 cava + '') ]; } diff --git a/waybar/config.jsonc b/waybar/config.jsonc index 8539641..1cbb67e 100644 --- a/waybar/config.jsonc +++ b/waybar/config.jsonc @@ -110,7 +110,7 @@ "format": "{icon}", "tooltip": false, "tooltip-format": "Change Wallpaper", - "on-click": "bash ~/dotfiles/.scripts/switch-wallpaper.sh &", + "on-click": "pywal", "format-icons": { "default": " ", },