diff --git a/bin/wallpaperctl b/bin/wallpaperctl new file mode 100755 index 0000000..a48b952 --- /dev/null +++ b/bin/wallpaperctl @@ -0,0 +1,21 @@ +#!/bin/bash + +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=~/Images/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 diff --git a/sync b/sync index 39818ba..be2189b 100755 --- a/sync +++ b/sync @@ -68,6 +68,7 @@ synced_files = [ ("bin/x11-toggle-primary-gpu", "~/.local/bin/x11-toggle-primary-gpu"), ("bin/uwu-launcher", "~/.local/bin/uwu-launcher"), ("bin/eww-bard", "~/.local/bin/eww-bard"), + ("bin/wallpaperctl", "~/.local/bin/wallpaperctl"), # Submodules ("Ahurac-dotfiles/bin/ssh-fwd", "~/.local/bin/ssh-fwd"), ]