From 64668524daeb4b7e81c5889633f240a78f46d739 Mon Sep 17 00:00:00 2001 From: Daniel Napora Date: Sat, 12 Feb 2022 13:37:36 +0100 Subject: [PATCH] mbwallpaper update --- bin/mbwallpaper | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/bin/mbwallpaper b/bin/mbwallpaper index b6702ad..3d2e0d0 100755 --- a/bin/mbwallpaper +++ b/bin/mbwallpaper @@ -29,6 +29,14 @@ case "$setter" in *) echo "Unknown wallpaper setter. Please check your config file $CONFIG_FILE";exit 1;; esac +#check if wallpaper dir was changed, if so delete wallpaper list +if [ ! -f "$CONFIG_DIR/.lastdir" ]; then + echo "$wallpaper_dir" > "$CONFIG_DIR/.lastdir" +else +lastdir=$(<$CONFIG_DIR/.lastdir) +[[ "$wallpaper_dir" != "$lastdir" ]] && rm "$WALLPAPERS_LIST" && echo "$wallpaper_dir" > "$CONFIG_DIR/.lastdir" +fi + checkwplist() { # If list does not exist or is empty if [[ ! -f $WALLPAPERS_LIST || $(wc -l <$WALLPAPERS_LIST) -lt 1 ]]; then