aboutsummaryrefslogtreecommitdiff
path: root/desktop/home/mosder/.config/hypr/scripts/randomize-wallpapers.sh
blob: b08b0b486884ebf401db1fefaab47cb79662ba89 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
#!/usr/bin/bash

WALLPAPER_DIR="$HOME/wallpapers"

# Get random wallpapers
WALLPAPER_MAIN=$(find $WALLPAPER_DIR -type f | shuf -n 1)
WALLPAPER_SECOND=$(find $WALLPAPER_DIR -type f | shuf -n 1)

# Create symlinks to new random wallpapers
SYMLINK_MAIN=$WALLPAPER_DIR/.current_main
SYMLINK_SECOND=$WALLPAPER_DIR/.current_second
rm $SYMLINK_MAIN
rm $SYMLINK_SECOND
ln -s $WALLPAPER_MAIN $SYMLINK_MAIN
ln -s $WALLPAPER_SECOND $SYMLINK_SECOND