hyprland/change-wallpaper.sh

14 lines
487 B
Bash
Raw Normal View History

2025-02-25 01:13:57 -08:00
#!/usr/bin/env bash
WALLPAPER_DIR="$HOME/Pictures/variety/"
CURRENT_WALL=$(hyprctl hyprpaper listloaded)
# Get a random wallpaper that is not the current one
WALLPAPER=$(find "$WALLPAPER_DIR" -type f ! -name "$(basename "$CURRENT_WALL")" ! -name "*.json" | shuf -n 1)
echo "Changing wallpaper to $WALLPAPER"
# Apply the selected wallpaper
hyprctl hyprpaper reload ,"$WALLPAPER"
notify-send -i hyprpaper -u normal "change-wallpaper.sh" "Wallpaper changed to ${WALLPAPER##*/variety/}"