Update background scripts

This commit is contained in:
2026-09-01 22:09:11 +01:00
parent 2931ea0e18
commit bc302dbb16
+4 -7
View File
@@ -2,16 +2,13 @@
# Sets the specified image as the current background # 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" BACKGROUND="$1"
CURRENT_BACKGROUND_LINK="$HOME/.local/state/station/background" CURRENT_BACKGROUND_LINK="$HOME/.local/state/station/background"
if [[ -f $BACKGROUND ]]; then
# Create symlink to the new background # Create symlink to the new background
ln -nsf "$BACKGROUND" "$CURRENT_BACKGROUND_LINK" ln -nsf "$BACKGROUND" "$CURRENT_BACKGROUND_LINK"
fi
wal -i "$CURRENT_BACKGROUND_LINK" wal -i "$CURRENT_BACKGROUND_LINK"
@@ -20,8 +17,8 @@ pkill -x swaybg
if [[ $(hyprctl monitors -j | jq 'length') -eq 2 ]]; then if [[ $(hyprctl monitors -j | jq 'length') -eq 2 ]]; then
station-bg-split "$CURRENT_BACKGROUND_LINK" "/tmp/bg" station-bg-split "$CURRENT_BACKGROUND_LINK" "/tmp/bg"
first_mon=$(hyprctl monitors -j | jq -r '.[0].name') first_mon=$(hyprctl monitors -j | jq -r 'map(select(.x == 0)) | .[0].name')
second_mon=$(hyprctl monitors -j | jq -r '.[1].name') second_mon=$(hyprctl monitors -j | jq -r 'map(select(.x > 0)) | .[0].name')
setsid uwsm-app -- swaybg -o "$first_mon" -i /tmp/bg/background_left -m fill >/dev/null 2>&1 & setsid uwsm-app -- swaybg -o "$first_mon" -i /tmp/bg/background_left -m fill >/dev/null 2>&1 &
setsid uwsm-app -- swaybg -o "$second_mon" -i /tmp/bg/background_right -m fill >/dev/null 2>&1 & setsid uwsm-app -- swaybg -o "$second_mon" -i /tmp/bg/background_right -m fill >/dev/null 2>&1 &
else else