Fix timeout, and source the user set wallpaperDir

This commit is contained in:
Tyler Kelley 2024-01-20 21:36:56 -06:00
parent 96c8731c47
commit 37a5fd5008

View File

@ -1,13 +1,13 @@
{ pkgs, username, wallpaperDir, wallpaperGit, ... }:
pkgs.writeShellScriptBin "wallsetter" ''
TIMEOUT=5
TIMEOUT=720
TRANSITION1="--transition-type wave --transition-angle 120 --transition-step 30"
TRANSITION2="--transition-type wipe --transition-angle 30 --transition-step 30"
TRANSITION3="--transition-type center --transition-step 30"
TRANSITION4="--transition-type outer --transition-pos 0.3,0.8 --transition-step 30"
TRANSITION5="--transition-type wipe --transition-angle 270 --transition-step 30"
WALLPAPER=$(find $HOME/Pictures/Wallpapers/ -name '*' | awk '!/.git/' | tail -n +2 | sed 's/ /\\ /g' | shuf -n 1)
WALLPAPER=$(find ${wallpaperDir} -name '*' | awk '!/.git/' | tail -n +2 | sed 's/ /\\ /g' | shuf -n 1)
PREVIOUS=$WALLPAPER
if [ -d ${wallpaperDir} ]; then
cd ${wallpaperDir}
@ -20,7 +20,7 @@ pkgs.writeShellScriptBin "wallsetter" ''
do
if [ "$WALLPAPER" == "$PREVIOUS" ]
then
WALLPAPER=$(find $HOME/Pictures/Wallpapers/ -name '*' | awk '!/.git/' | tail -n +2 | sed 's/ /\\ /g' | shuf -n 1)
WALLPAPER=$(find ${wallpaperDir} -name '*' | awk '!/.git/' | tail -n +2 | sed 's/ /\\ /g' | shuf -n 1)
else
PREVIOUS=$WALLPAPER
NUM=$(shuf -i 1-5 -n 1)