diff options
Diffstat (limited to 'randomize_hyprpaper.sh')
-rwxr-xr-x | randomize_hyprpaper.sh | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/randomize_hyprpaper.sh b/randomize_hyprpaper.sh new file mode 100755 index 0000000..a8457d5 --- /dev/null +++ b/randomize_hyprpaper.sh @@ -0,0 +1,20 @@ +#!/usr/bin/env sh + +###################################################################### +# @author : pico (pico@$HOSTNAME) +# @file : randomize_hyprpaper +# @created : Sunday Jun 08, 2025 18:03:22 CST +# +# @description : +###################################################################### + +WALLPAPER_DIR="$HOME/data/pictures/wallpaper/" +CURRENT_WALL=$(hyprctl hyprpaper listloaded) + +# Get the name of the focused monitor with hyprctl +FOCUSED_MONITOR=$(hyprctl monitors -j | jq -r '.[] | select(.focused) | .name') + +# Get a random wallpaper that is not the current one +WALLPAPER=$(find "$WALLPAPER_DIR" -type f ! -name "$(basename "$CURRENT_WALL")" | shuf -n 1) + +hyprctl hyprpaper reload "$FOCUSED_MONITOR","$WALLPAPER" |