25 lines
666 B
Bash
Executable File
25 lines
666 B
Bash
Executable File
#!/bin/bash
|
|
|
|
# omarchy:summary=Set the current background image
|
|
# omarchy:args=<path-to-image>
|
|
# omarchy:examples=omarchy theme bg set ~/Pictures/wallpaper.png
|
|
|
|
if [[ -z $1 ]]; then
|
|
echo "Usage: omarchy-theme-bg-set <path-to-image>" >&2
|
|
exit 1
|
|
fi
|
|
|
|
BACKGROUND="$(realpath "$1")"
|
|
CURRENT_BACKGROUND_LINK="$HOME/.config/omarchy/current/background"
|
|
|
|
if [[ ! -f "$BACKGROUND" ]]; then
|
|
echo "File does not exist: $BACKGROUND" >&2
|
|
exit 1
|
|
fi
|
|
|
|
# Create symlink to the new background
|
|
ln -nsf "$BACKGROUND" "$CURRENT_BACKGROUND_LINK"
|
|
|
|
# Apply the new background through Skwd-wall
|
|
skwd wall apply "{\"type\":\"static\",\"path\":\"$CURRENT_BACKGROUND_LINK\"}" >/dev/null
|