diff options
author | Yaroslav de la Peña Smirnov <yps@yaroslavps.com> | 2024-11-11 18:29:27 +0300 |
---|---|---|
committer | Yaroslav de la Peña Smirnov <yps@yaroslavps.com> | 2024-11-11 18:29:27 +0300 |
commit | 7381a853a264ffdf8e3a9f58da465ca77fdacbb5 (patch) | |
tree | 29a7b6664bd9a40119dafa01cb858a51ea1ecd43 /dotfiles/.local/bin/setbg | |
parent | bc1b161f5c280d087c50fd1ec7a4221796cbb767 (diff) | |
download | swayrice-niri.tar.gz swayrice-niri.zip |
setbg: primitively support niriniri
Diffstat (limited to 'dotfiles/.local/bin/setbg')
-rwxr-xr-x | dotfiles/.local/bin/setbg | 11 |
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 |