diff options
| author | JaKooLit <jimmielovejay@gmail.com> | 2023-11-11 20:43:58 +0900 |
|---|---|---|
| committer | JaKooLit <jimmielovejay@gmail.com> | 2023-11-11 20:43:58 +0900 |
| commit | b83a43f3500afa1c8934aace2eda3c8489f04a12 (patch) | |
| tree | 56f7808dc300d8006d7b057579a53d835c8576b5 | |
| parent | 9c9802171b3a3a239493d1fe6a04f3dc0de00971 (diff) | |
uploaded wallpaperrandom.sh
| -rwxr-xr-x | config/hypr/scripts/WallpaperRandom.sh | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/config/hypr/scripts/WallpaperRandom.sh b/config/hypr/scripts/WallpaperRandom.sh new file mode 100755 index 00000000..e7d91ec1 --- /dev/null +++ b/config/hypr/scripts/WallpaperRandom.sh @@ -0,0 +1,35 @@ +#!/bin/bash + +# 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_script=$HOME/.config/hypr/scripts/PywalSwww.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_STEP=2 +export SWWW_TRANSITION_TYPE=random + +# This controls (in seconds) when to switch to the next image +INTERVAL=300 + +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_script + sleep $INTERVAL + + done +done |
