dotfiles/.config/hypr/scripts/wallpaper
2023-10-13 00:43:15 +02:00

24 lines
752 B
Bash
Executable file

#!/usr/bin/bash
mode=$1
if [ "$mode" = "" ]; then
echo "Usage: $0 [select|random]"
exit 1
fi
if [ "$mode" == "select" ]; then
IMAGE=$(rofi -show file-browser-extended -theme ~/.config/rofi/style.rasi -file-browser-stdout -file-browser-dir "$HOME"/.config/hypr/themes/luna/walls/)
if [ "$IMAGE" = "" ]; then
exit 1
fi
elif [ "$mode" == "random" ]; then
RANDOM_IMAGE=$(fd -e png -e jpg --base-directory "$HOME/.config/hypr/themes/luna/walls/" --type f . | shuf -n 1)
IMAGE="$HOME/.config/hypr/themes/luna/walls/$RANDOM_IMAGE"
else
exit 1
fi
swww img --transition-type grow --transition-pos top-right --transition-fps 75 --transition-duration 3.8 --transition-step 255 "$IMAGE"
notify-send "Wallpaper Changed" "Wallpaper changed to $IMAGE"