diff options
| author | silly <u65487754@gmail.com> | 2026-03-09 02:02:55 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2026-03-09 02:02:55 +0100 |
| commit | 1407262b35cef30619c47aa5fbe0a590499d7bfe (patch) | |
| tree | 2a7f66cab2fd7eadcccf9f8f6a1797366c4c69d0 /.config/scripts | |
| parent | 3b05fc597c633f71e7bf4aa7a57870896165b35a (diff) | |
Update wallpaper.sh
Diffstat (limited to '.config/scripts')
| -rw-r--r-- | .config/scripts/wallpaper.sh | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/.config/scripts/wallpaper.sh b/.config/scripts/wallpaper.sh index 309d367..b04b8aa 100644 --- a/.config/scripts/wallpaper.sh +++ b/.config/scripts/wallpaper.sh @@ -1,13 +1,15 @@ #!/bin/bash WALL_DIR="$HOME/.config/wallpaper" +CACHE_PATH="$HOME/.cache/current_wallpaper.png" 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) + current_wall=$(basename "$(readlink -f "$CACHE_PATH")") + selected=$(ls "$WALL_DIR" | grep -v "$current_wall" | shuf -n 1) fi FULL_PATH="$WALL_DIR/$selected" @@ -15,7 +17,8 @@ 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 -ln -sf "$FULL_PATH" "$HOME/.cache/wallpaper.*" + +ln -sf "$FULL_PATH" "$CACHE_PATH" kill -SIGUSR1 $(pgrep kitty) 2>/dev/null |
