Files
dotfiles/.local/bin/station-bg-set
2026-03-08 20:51:14 +00:00

21 lines
500 B
Bash
Executable File

#!/bin/bash
# Sets the specified image as the current background
if [[ -z $1 ]]; then
echo "Usage: station-bg-set <path-to-image>" >&2
exit 1
fi
BACKGROUND="$1"
CURRENT_BACKGROUND_LINK="$HOME/.local/state/station/background"
# Create symlink to the new background
ln -nsf "$BACKGROUND" "$CURRENT_BACKGROUND_LINK"
wal -i "$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 &