stow_dotfiles/scripts/.local/bin/hyprpaperchanger
Matthieu Fortin (CPC/CCP) 4610557207 updates
2024-10-30 14:36:15 -04:00

15 lines
461 B
Bash
Executable file

#!/bin/bash
set -euo pipefail
directory=~/Pictures/wallpapers
wallpaper=~/.cache/images/wallpaper.png
monitor=$(hyprctl monitors | grep Monitor | awk '{print $2}')
if [ -d "$directory" ]; then
#random_background=$(ls $directory | shuf -n 1)
random_background=$(find $directory -type f | shuf -n 1)
wallpaper $random_background
hyprctl hyprpaper unload all
hyprctl hyprpaper preload $wallpaper
hyprctl hyprpaper wallpaper "$monitor, $wallpaper"
fi