dotfiles/scripts/random_hyprpaper.sh
2024-04-05 01:32:44 +09:00

26 lines
690 B
Bash
Executable File

#!/bin/bash
wal_dir1=~/walls/normal
wal_dir2=~/walls/normal
# random wallpaper
files=()
while IFS= read -r -d $'\0'; do
files+=("$REPLY")
done < <(find $wal_dir1 -type f -name "*" -print0)
randomfile=$(printf "%s\n" "${files[RANDOM % ${#files[@]}]}")
echo $randomfile
hyprctl hyprpaper preload $randomfile
hyprctl hyprpaper wallpaper "DP-3,contain:$randomfile"
files=()
while IFS= read -r -d $'\0'; do
files+=("$REPLY")
done < <(find $wal_dir2 -type f -name "*" -print0)
randomfile=$(printf "%s\n" "${files[RANDOM % ${#files[@]}]}")
echo $randomfile
hyprctl hyprpaper preload $randomfile
hyprctl hyprpaper wallpaper "HDMI-A-1,contain:$randomfile"
hyprctl hyprpaper unload all