mbwallpaper update

master
Daniel Napora 2022-02-12 13:37:36 +01:00
parent 1d63afbc07
commit 64668524da
1 changed files with 8 additions and 0 deletions

View File

@ -29,6 +29,14 @@ case "$setter" in
*) echo "Unknown wallpaper setter. Please check your config file $CONFIG_FILE";exit 1;; *) echo "Unknown wallpaper setter. Please check your config file $CONFIG_FILE";exit 1;;
esac 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() { checkwplist() {
# If list does not exist or is empty # If list does not exist or is empty
if [[ ! -f $WALLPAPERS_LIST || $(wc -l <$WALLPAPERS_LIST) -lt 1 ]]; then if [[ ! -f $WALLPAPERS_LIST || $(wc -l <$WALLPAPERS_LIST) -lt 1 ]]; then