diff options
| author | JaKooLit <jimmielovejay.com> | 2024-01-01 18:43:31 +0900 |
|---|---|---|
| committer | JaKooLit <jimmielovejay.com> | 2024-01-01 18:43:31 +0900 |
| commit | 2bbe867a07895b5bfdd00722830324fb1b37cf11 (patch) | |
| tree | d344007ddc9614137c64b6ea4bf619310646e59f /config/hypr/UserScripts/WallpaperRandom.sh | |
| parent | f7c551d45dee4dee7b2ae7af635506f6bad0c1bc (diff) | |
Just a small tinkering... :)
Diffstat (limited to 'config/hypr/UserScripts/WallpaperRandom.sh')
| -rwxr-xr-x | config/hypr/UserScripts/WallpaperRandom.sh | 47 |
1 files changed, 19 insertions, 28 deletions
diff --git a/config/hypr/UserScripts/WallpaperRandom.sh b/config/hypr/UserScripts/WallpaperRandom.sh index 13bd2995..f8cc54f9 100755 --- a/config/hypr/UserScripts/WallpaperRandom.sh +++ b/config/hypr/UserScripts/WallpaperRandom.sh @@ -1,35 +1,26 @@ #!/bin/bash +## /* ---- 💫 https://github.com/JaKooLit 💫 ---- */ ## +# Script for Random Wallpaper ( CTRL ALT W) -# 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 +wallDIR="$HOME/Pictures/wallpapers" +scriptsDir="$HOME/.config/hypr/scripts" -pywal_refresh=$HOME/.config/hypr/scripts/RefreshNoWaybar.sh +PICS=($(find ${wallDIR} -type f \( -name "*.jpg" -o -name "*.jpeg" -o -name "*.png" -o -name "*.gif" \))) +RANDOMPICS=${PICS[ $RANDOM % ${#PICS[@]} ]} -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 +# Transition config +FPS=60 +TYPE="random" +DURATION=1 +BEZIER=".43,1.19,1,.4" +SWWW_PARAMS="--transition-fps $FPS --transition-type $TYPE --transition-duration $DURATION --transition-bezier $BEZIER" -# 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 +swww query || swww init && swww img ${RANDOMPICS} $SWWW_PARAMS + + +${scriptsDir}/PywalSwww.sh +sleep 1 +${scriptsDir}/Refresh.sh + |
