feat: random wallpaper script for both screens
This commit is contained in:
@@ -2,7 +2,7 @@
|
||||
|
||||
WALLPAPER_DIR="$HOME/Pictures/Wallpapers/current/"
|
||||
INTRO_DIR="$HOME/Pictures/Wallpapers/intro/"
|
||||
DELAY=5m
|
||||
DELAY=3m
|
||||
|
||||
intro() {
|
||||
if [ -z "$(ls -A "$WALLPAPER_DIR")" ]; then
|
||||
@@ -40,15 +40,23 @@ random_wallpaper() {
|
||||
|
||||
# Apply the selected wallpaper
|
||||
hyprctl hyprpaper unload all
|
||||
hyprctl hyprpaper reload ,"$WALLPAPER"
|
||||
hyprctl hyprpaper reload $1,"$WALLPAPER"
|
||||
|
||||
if [ $? -ne 0 ]; then
|
||||
echo "The previous command failed."
|
||||
# Handle the error here
|
||||
hyprpaper &
|
||||
sleep 1
|
||||
hyprctl hyprpaper reload ,"$WALLPAPER"
|
||||
fi
|
||||
|
||||
echo "Set random wallpaper to $WALLPAPER"
|
||||
}
|
||||
|
||||
loop() {
|
||||
intro
|
||||
while true; do
|
||||
random_wallpaper
|
||||
random_wallpaper "eDP-1"
|
||||
random_wallpaper "HDMI-A-1"
|
||||
sleep "$DELAY"
|
||||
done
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user