pointfichiers/bin/wallpaperctl
2024-11-15 13:21:37 +01:00

21 lines
453 B
Bash
Executable file

#!/bin/sh
if [[ $# -lt 1 ]] || [[ ! $1 = @(daemon|change) ]]; then
echo "Usage:
$0 daemon|change"
exit 1
fi
export SWWW_TRANSITION=wipe
export SWWW_TRANSITION_ANGLE=$RANDOM
export SWWW_TRANSITION_FPS=60
wallpapers_dir=~/Pictures/Wallpapers/enabled
if [[ "$1" = "daemon" ]]; then
exec swww-daemon
elif [[ "$1" = "change" ]]; then
img=$(find "$wallpapers_dir" -type f,l -exec realpath {} \; | shuf -n 1)
echo "$img"
exec swww img "$img"
fi