Setup keybinding for changing the wallpaper

This commit is contained in:
Tyler Kelley 2024-05-17 05:15:00 -05:00
parent a94dfa0fd7
commit daf9e9c639
2 changed files with 4 additions and 0 deletions

View File

@ -132,6 +132,7 @@ with lib;
bind = ${modifier},Return,exec,${terminal}
bind = ${modifier}SHIFT,Return,exec,wofi
bind = ${modifier}SHIFT,W,exec,web-search
bind = ${modifier}ALT,W,exec,wallsetter
bind = ${modifier}SHIFT,N,exec,swaync-client -rs
bind = ${modifier},W,exec,${browser}
bind = ${modifier},E,exec,emopicker9000

View File

@ -2,6 +2,9 @@
pkgs.writeShellScriptBin "wallsetter" ''
WALLPAPER=$(find /home/${username}/Pictures/Wallpapers -name '*' | awk '!/.git/' | tail -n +2 | shuf -n 1)
if [ $WALLPAPER == $PREVIOUS ]; then
WALLPAPER=$(find /home/${username}/Pictures/Wallpapers -name '*' | awk '!/.git/' | tail -n +2 | shuf -n 1)
fi
PREVIOUS=$WALLPAPER
if [ -d /home/${username}/Pictures/Wallpapers ]; then
num_files=$(ls -1 /home/${username}/Pictures/Wallpapers | wc -l)