Update blob_wallpaper script to use ~/wallpapers directory

This commit is contained in:
2026-04-20 12:21:16 -04:00
parent 8a081737d3
commit 68a165862d
2 changed files with 18 additions and 5 deletions
+1
View File
@@ -144,6 +144,7 @@ backup_and_copy "$SCRIPT_DIR/ags" "$HOME_DIR/.config/ags" "AGS config"
backup_and_copy "$SCRIPT_DIR/hypr" "$HOME_DIR/.config/hypr" "Hyprland config" backup_and_copy "$SCRIPT_DIR/hypr" "$HOME_DIR/.config/hypr" "Hyprland config"
backup_and_copy "$SCRIPT_DIR/branding" "$HOME_DIR/.config/omarchy/branding" "Branding files" backup_and_copy "$SCRIPT_DIR/branding" "$HOME_DIR/.config/omarchy/branding" "Branding files"
backup_and_copy "$SCRIPT_DIR/omarchy/hooks" "$HOME_DIR/.config/omarchy/hooks" "Omarchy hooks" backup_and_copy "$SCRIPT_DIR/omarchy/hooks" "$HOME_DIR/.config/omarchy/hooks" "Omarchy hooks"
backup_and_copy "$SCRIPT_DIR/wallpapers" "$HOME_DIR/wallpapers" "Custom wallpapers"
mkdir -p "$HOME_DIR/scripts" mkdir -p "$HOME_DIR/scripts"
backup_and_copy "$SCRIPT_DIR/scripts" "$HOME_DIR/scripts" "Custom scripts" backup_and_copy "$SCRIPT_DIR/scripts" "$HOME_DIR/scripts" "Custom scripts"
+16 -4
View File
@@ -1,13 +1,25 @@
#!/bin/bash #!/bin/bash
WALLPAPER_DIR="$HOME/wallpapers"
# Create the directory if it doesn't exist
mkdir -p "$WALLPAPER_DIR"
if [ -z "$1" ]; then if [ -z "$1" ]; then
echo "Usage: blob_wallpaper <path-to-image>" echo "Usage: blob_wallpaper <filename-or-path>"
echo "Available wallpapers in $WALLPAPER_DIR:"
ls -1 "$WALLPAPER_DIR" 2>/dev/null || echo "No wallpapers found."
exit 1 exit 1
fi fi
# Check if the argument is a file in the wallpapers directory
if [ -f "$WALLPAPER_DIR/$1" ]; then
IMAGE_PATH=$(realpath "$WALLPAPER_DIR/$1")
# Check if the argument is an absolute or relative path
elif [ -f "$1" ]; then
IMAGE_PATH=$(realpath "$1") IMAGE_PATH=$(realpath "$1")
else
if [ ! -f "$IMAGE_PATH" ]; then echo "Error: File '$1' does not exist in $WALLPAPER_DIR or as a valid path."
echo "Error: File '$IMAGE_PATH' does not exist."
exit 1 exit 1
fi fi