diff options
| author | Ja.KooLit <jimmielovejay@gmail.com> | 2024-01-02 01:21:53 +0900 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-01-02 01:21:53 +0900 |
| commit | 1acea95602ecd292f4c806ce946c0ab33176e4ce (patch) | |
| tree | a43d4ccfd313a4effa92919fef8d96934c23bac8 /config/hypr/UserScripts/WallpaperAutoChange.sh | |
| parent | 3d0283f6c0f323bf504d99aadb0019e6357048a8 (diff) | |
| parent | e2bcb89ce79d0a0469e3eb362cc0cc802ddac208 (diff) | |
Merge pull request #116 from JaKooLit/development
Development
Diffstat (limited to 'config/hypr/UserScripts/WallpaperAutoChange.sh')
| -rwxr-xr-x | config/hypr/UserScripts/WallpaperAutoChange.sh | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/config/hypr/UserScripts/WallpaperAutoChange.sh b/config/hypr/UserScripts/WallpaperAutoChange.sh new file mode 100755 index 00000000..56f2ee05 --- /dev/null +++ b/config/hypr/UserScripts/WallpaperAutoChange.sh @@ -0,0 +1,37 @@ +#!/bin/bash +## /* ---- 💫 https://github.com/JaKooLit 💫 ---- */ ## +# source https://wiki.archlinux.org/title/Hyprland#Using_a_script_to_change_wallpaper_every_X_minutes + +# This script will randomly go through the files of a directory, setting it +# up as the wallpaper at regular intervals +# +# NOTE: this script uses bash (not POSIX shell) for the RANDOM variable + +pywal_refresh=$HOME/.config/hypr/scripts/RefreshNoWaybar.sh + +if [[ $# -lt 1 ]] || [[ ! -d $1 ]]; then + echo "Usage: + $0 <dir containing images>" + exit 1 +fi + +# Edit below to control the images transition +export SWWW_TRANSITION_FPS=60 +export SWWW_TRANSITION_TYPE=simple + +# This controls (in seconds) when to switch to the next image +INTERVAL=1800 + +while true; do + find "$1" \ + | while read -r img; do + echo "$((RANDOM % 1000)):$img" + done \ + | sort -n | cut -d':' -f2- \ + | while read -r img; do + swww img "$img" + $pywal_refresh + sleep $INTERVAL + + done +done |
