aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xdotfiles/.local/bin/setbg11
1 files changed, 9 insertions, 2 deletions
diff --git a/dotfiles/.local/bin/setbg b/dotfiles/.local/bin/setbg
index 9daca99..2e6dfba 100755
--- a/dotfiles/.local/bin/setbg
+++ b/dotfiles/.local/bin/setbg
@@ -3,6 +3,13 @@
mon="1"
[ -n "$2" ] && mon="$2"
-cp $1 "$HOME/.config/wall$mon.png"
+dest="$HOME/.config/wall$mon.png"
-updisplay
+cp "$1" "$dest"
+
+if [ -n "$SWAYSOCK" ]; then
+ updisplay
+elif [ -n "$NIRI_SOCKET" ]; then
+ killall swaybg
+ setsid swaybg -i "$dest" -m fill&
+fi