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