diff options
Diffstat (limited to 'dotfiles/.local/bin/setbg')
-rwxr-xr-x | dotfiles/.local/bin/setbg | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/dotfiles/.local/bin/setbg b/dotfiles/.local/bin/setbg index 351ac3d..eb319d0 100755 --- a/dotfiles/.local/bin/setbg +++ b/dotfiles/.local/bin/setbg @@ -1,4 +1,13 @@ #!/bin/sh -cp $1 ~/.config/wall1.png -swaymsg output "*" background ~/.config/wall1.png fill +mon="1" +[ -n "$2" ] && mon="$2" + +cp $1 "$HOME/.config/wall$mon.png" + +IFS=$'\n' +outputcf=$(grep '^output .* background.*$' ~/.config/sway/config) + +for line in $outputcf; do + swaymsg $line +done |