aboutsummaryrefslogtreecommitdiff
path: root/bin
diff options
context:
space:
mode:
authorBardofSprites <[email protected]>2025-07-17 10:20:00 -0400
committerBardofSprites <[email protected]>2025-07-17 10:20:00 -0400
commit682349094073f0e33951001edeac5c72c9f43145 (patch)
tree1185d2bb6ced72f45ba05836447b97befec8bb1d /bin
parent3d45bf409bbd5e8575a848222ef318890e1f488e (diff)
don't clean cache file unless selected
Diffstat (limited to 'bin')
-rwxr-xr-xbin/.local/bin/scripts/wallpaper.sh9
1 files changed, 7 insertions, 2 deletions
diff --git a/bin/.local/bin/scripts/wallpaper.sh b/bin/.local/bin/scripts/wallpaper.sh
index 5e77767..ba230b0 100755
--- a/bin/.local/bin/scripts/wallpaper.sh
+++ b/bin/.local/bin/scripts/wallpaper.sh
@@ -1,13 +1,15 @@
#!/bin/bash
-# Clean wallpaper cache file
-sed -i '/feh/d' $HOME/.cache/wallpaper
# Path to the directory containing your wallpapers
WALLPAPER_DIRS="$HOME/Pictures/wallpaper/\n$HOME/Pictures/other-wallpaper/"
WALLPAPER_DIR=$(echo -e "$WALLPAPER_DIRS" | dmenu -p "Select directory: ")
+if [ -z "$WALLPAPER_DIR" ]; then
+ exit 1
+fi
+
# Use nsxiv to mark an image
selected_wallpaper=$(nsxiv -t -r -o $WALLPAPER_DIR)
@@ -17,6 +19,9 @@ OPTIONS="Tiled\nZoom Filled\nCentered\nMax"
# Prompt user to select a display mode
selected_mode=$(echo -e "$OPTIONS" | dmenu -p "Select Display Mode:")
+# Clean wallpaper cache file
+sed -i '/feh/d' $HOME/.cache/wallpaper
+
# Command to set wallpaper based on selected mode
case "$selected_mode" in
"Tiled")