stow_dotfiles/hyprland/.config/hypr/scripts/wallpaper-automation.sh
2024-09-27 14:01:51 -04:00

22 lines
677 B
Bash
Executable file

#!/bin/bash
sec=60
_setWallpaperRandomly() {
waypaper --random
echo ":: Next wallpaper in $sec seconds..."
sleep $sec
_setWallpaperRandomly
}
if [ ! -f ~/.cache/hyprland/wallpaper-automation ] ;then
touch ~/.cache/hyprland/wallpaper-automation
echo ":: Start wallpaper automation script"
notify-send "Wallpaper automation process started" "Wallpaper will be changed every $sec seconds."
_setWallpaperRandomly
else
rm ~/.cache/hyprland/wallpaper-automation
notify-send "Wallpaper automation process stopped."
echo ":: Wallpaper automation script process $wp stopped"
wp=$(pgrep -f wallpaper-automation.sh)
kill -KILL $wp
fi