You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
20 lines
729 B
20 lines
729 B
#!/bin/bash
|
|
|
|
SCRIPTS_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )
|
|
source $SCRIPTS_DIR/config.sh
|
|
|
|
directory=$WALLPAPER_DIR
|
|
monitor=`hyprctl monitors | grep Monitor | awk '{print $2}'`
|
|
|
|
if [ -d "$directory" ]; then
|
|
random_background=$(ls $directory/* | shuf -n 1)
|
|
file_extension="${random_background##*.}"
|
|
echo "File extension: $file_extension"
|
|
notify-send "Wallpaper Switched to :" "$random_background" --icon=dialog-information -t 3000
|
|
hyprctl hyprpaper unload all
|
|
hyprctl hyprpaper preload $random_background
|
|
hyprctl hyprpaper wallpaper "$monitor, $random_background"
|
|
else
|
|
notify-send "Wallpaper Switch : Directory Not Found" "$WALLPAPER_DIR" --icon=dialog-information -t 3000
|
|
fi
|