aboutsummaryrefslogtreecommitdiff
path: root/dotfiles/.local/bin/setbg
blob: bc8b8a299285751338348ed77ad47a30181e33e5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
#!/bin/sh

mon="1"
[ -n "$2" ] && mon="$2"

dest="$HOME/.config/wall$mon.png"

cp "$1" "$dest"

if [ -n "$SWAYSOCK" ]; then
	updisplay
elif [ -n "$NIRI_SOCKET" ]; then
	niri msg action do-screen-transition -d 200
	killall swaybg
	setsid swaybg -i "$dest" -m fill&
fi