summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.config/scripts/wallpaper.sh10
1 files changed, 8 insertions, 2 deletions
diff --git a/.config/scripts/wallpaper.sh b/.config/scripts/wallpaper.sh
index c754cc0..e5d389a 100644
--- a/.config/scripts/wallpaper.sh
+++ b/.config/scripts/wallpaper.sh
@@ -2,15 +2,21 @@
WALL_DIR="$HOME/.config/wallpaper"
-selected=$(ls "$WALL_DIR" | fuzzel -d -p "> ")
+selected=$(echo -e "random\n$(ls "$WALL_DIR")" | fuzzel -d -p "> ")
+
[[ -z "$selected" ]] && exit
+
+if [ "$selected" = "random" ]; then
+ selected=$(ls "$WALL_DIR" | shuf -n 1)
+fi
+
FULL_PATH="$WALL_DIR/$selected"
swww img "$FULL_PATH" --transition-type grow --transition-duration 1.5 --transition-fps 120
wal -i "$FULL_PATH" -n -q
-kill -SIGUSR1 $(pgrep kitty)
+kill -SIGUSR1 $(pgrep kitty) 2>/dev/null
killall dunst
dunst &