Update blob_wallpaper script to use ~/wallpapers directory
This commit is contained in:
@@ -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/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/wallpapers" "$HOME_DIR/wallpapers" "Custom wallpapers"
|
||||
|
||||
mkdir -p "$HOME_DIR/scripts"
|
||||
backup_and_copy "$SCRIPT_DIR/scripts" "$HOME_DIR/scripts" "Custom scripts"
|
||||
|
||||
@@ -1,13 +1,25 @@
|
||||
#!/bin/bash
|
||||
|
||||
WALLPAPER_DIR="$HOME/wallpapers"
|
||||
|
||||
# Create the directory if it doesn't exist
|
||||
mkdir -p "$WALLPAPER_DIR"
|
||||
|
||||
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
|
||||
fi
|
||||
|
||||
IMAGE_PATH=$(realpath "$1")
|
||||
|
||||
if [ ! -f "$IMAGE_PATH" ]; then
|
||||
echo "Error: File '$IMAGE_PATH' does not exist."
|
||||
# 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")
|
||||
else
|
||||
echo "Error: File '$1' does not exist in $WALLPAPER_DIR or as a valid path."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
|
||||
Reference in New Issue
Block a user