diff options
| author | Ryan Schanzenbacher <ryan@rschanz.org> | 2026-08-24 01:47:36 -0400 |
|---|---|---|
| committer | Ryan Schanzenbacher <ryan@rschanz.org> | 2026-08-24 01:47:36 -0400 |
| commit | 6c4fc5e429f362c0c5544d34f17285c4cfc16ba8 (patch) | |
| tree | 47177652c89aeafe7dde2396277c76e1c464eec1 /home-config/hypr/wallpaper-daemon.sh | |
| parent | 72d1c1aae5c6ef87a88e81111a74d7b041c57a22 (diff) | |
remove old filesand bump nix-files
Diffstat (limited to 'home-config/hypr/wallpaper-daemon.sh')
| -rwxr-xr-x | home-config/hypr/wallpaper-daemon.sh | 35 |
1 files changed, 0 insertions, 35 deletions
diff --git a/home-config/hypr/wallpaper-daemon.sh b/home-config/hypr/wallpaper-daemon.sh deleted file mode 100755 index b793c5a..0000000 --- a/home-config/hypr/wallpaper-daemon.sh +++ /dev/null | |||
| @@ -1,35 +0,0 @@ | |||
| 1 | #!/usr/bin/env bash | ||
| 2 | |||
| 3 | # Script initialization | ||
| 4 | # Check if animated wallpapers exist, set env var if so | ||
| 5 | # Sleep for swww init to finish | ||
| 6 | init_static() { | ||
| 7 | # On battery or missing wallpapers, just load a random image | ||
| 8 | IMG=`find ~/.config/hypr/Wallpapers/static/ -type f | sort -R | tail -n1` | ||
| 9 | echo $IMG >> /tmp/$USER-desktop-anim | ||
| 10 | swww img $IMG | ||
| 11 | } | ||
| 12 | |||
| 13 | begin_randomizer() { | ||
| 14 | while :; do | ||
| 15 | sleep 3600 | ||
| 16 | switch_check `find ~/.config/hypr/Wallpapers/static/ -type f | sort -R | tail -n1` | ||
| 17 | done | ||
| 18 | } | ||
| 19 | |||
| 20 | switch_check() { | ||
| 21 | # Simply query what image is displayed and make sure we do not overwrite | ||
| 22 | # it. This is more for animated wallpapers since it causes corruption | ||
| 23 | CURRENT_FILE=`swww query | awk -F'/' '{print $NF}'` | ||
| 24 | SELECTION=`echo $1 | awk -F'/' '{print $NF}'` | ||
| 25 | |||
| 26 | if ! [ "$CURRENT_FILE" == "$SELECTION" ]; then | ||
| 27 | # Update the file | ||
| 28 | sed -i '2c'"$1" /tmp/$USER-desktop-anim | ||
| 29 | # Set the background! | ||
| 30 | swww img $1 | ||
| 31 | fi | ||
| 32 | } | ||
| 33 | |||
| 34 | init_static | ||
| 35 | begin_randomizer & | ||
