Fixed wallsetter not accepting wallpapers with spaces

This commit is contained in:
Tyler Kelley 2024-01-20 21:34:02 -06:00
parent 5419daba34
commit 96c8731c47
2 changed files with 12 additions and 9 deletions

View File

@ -1,23 +1,26 @@
{ pkgs, username, wallpaperDir, wallpaperGit, ... }:
pkgs.writeShellScriptBin "wallsetter" ''
TIMEOUT=720
TIMEOUT=5
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 ${wallpaperDir}/* -type f | shuf -n 1)
WALLPAPER=$(find $HOME/Pictures/Wallpapers/ -name '*' | awk '!/.git/' | tail -n +2 | sed 's/ /\\ /g' | shuf -n 1)
PREVIOUS=$WALLPAPER
rm -rf ${wallpaperDir}
${pkgs.git}/bin/git clone ${wallpaperGit} ${wallpaperDir}
sleep 1
chown -R ${username}:users ${wallpaperDir}
if [ -d ${wallpaperDir} ]; then
cd ${wallpaperDir}
git pull
else
${pkgs.git}/bin/git clone ${wallpaperGit} ${wallpaperDir}
chown -R ${username}:users ${wallpaperDir}
fi
while true;
do
if [ $WALLPAPER == $PREVIOUS ]
if [ "$WALLPAPER" == "$PREVIOUS" ]
then
WALLPAPER=$(find ${wallpaperDir}/* -type f | shuf -n 1)
WALLPAPER=$(find $HOME/Pictures/Wallpapers/ -name '*' | awk '!/.git/' | tail -n +2 | sed 's/ /\\ /g' | shuf -n 1)
else
PREVIOUS=$WALLPAPER
NUM=$(shuf -i 1-5 -n 1)

View File

@ -20,7 +20,7 @@
gitEmail = "tylerzanekelley@gmail.com";
theLocale = "en_US.UTF-8";
theTimezone = "America/Chicago";
theme = "gruvbox-dark-medium";
theme = "tokyo-night-storm";
browser = "firefox";
wallpaperGit = "https://gitlab.com/Zaney/my-wallpapers.git";
wallpaperDir = "/home/${username}/Pictures/Wallpapers";