Files
dotfiles/script/omarchy-theme-bg-set
T
gitadmin b6b738fc7b chore: migrate omarchy state from ~/.config to ~/.local/state
Move all omarchy runtime state (themes, backgrounds, current theme)
from ~/.config/omarchy/current to ~/.local/state/omarchy/current
to keep the config dir free of generated files. Add mise task for
recreating symlinks and update credential helpers for tea.
2026-09-03 20:46:18 -04:00

26 lines
676 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/.local/state/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"
# Kill existing swaybg and start new one
pkill -x swaybg
setsid uwsm-app -- swaybg -i "$CURRENT_BACKGROUND_LINK" -m fill >/dev/null 2>&1 &