diff options
| author | Yaroslav <contact@yaroslavps.com> | 2020-08-18 14:45:57 +0300 | 
|---|---|---|
| committer | Yaroslav <contact@yaroslavps.com> | 2020-08-18 14:45:57 +0300 | 
| commit | b3318da576333bd5caf32506b6706638e40ca458 (patch) | |
| tree | 2735e5eb903c6b4da3c9d4b78def7df26ccebe55 | |
| parent | 7866c246f312d78c9838179aaa21dbc645802f63 (diff) | |
| download | swayrice-b3318da576333bd5caf32506b6706638e40ca458.tar.gz swayrice-b3318da576333bd5caf32506b6706638e40ca458.zip | |
Easier to set different wallpapers on my desktop
* Change setbg script so that it can copy and set wallpapers to
different monitors depending on my sway config
* Add key shortcut to sxiv to set second monitor's wallaper
* Make the wallpaper of the second output different in sway config
| -rw-r--r-- | dotfiles/.config/sway/config | 2 | ||||
| -rwxr-xr-x | dotfiles/.config/sxiv/exec/key-handler | 5 | ||||
| -rwxr-xr-x | dotfiles/.local/bin/setbg | 13 | 
3 files changed, 17 insertions, 3 deletions
| diff --git a/dotfiles/.config/sway/config b/dotfiles/.config/sway/config index 0645b2e..c8da8ea 100644 --- a/dotfiles/.config/sway/config +++ b/dotfiles/.config/sway/config @@ -107,6 +107,7 @@ input 2:10:TPPS/2_IBM_TrackPoint pointer_accel 1  # Outputs  output "*" background ~/.config/wall1.png fill +output "HDMI-A-2" background ~/.config/wall2.png fill  # Laptop display  output "eDP-1" scale 1.6 pos 0 0 scale_filter linear  # Two monitor layout @@ -336,6 +337,7 @@ bindsym --to-code {      # Gaps      $mod+semicolon		      gaps inner current set 15; gaps outer current set 0      $mod+Shift+semicolon		gaps inner current set 0; gaps outer current set 0 +    $mod+Ctrl+semicolon		gaps inner current set 45; gaps outer current set 15      $mod+period			    gaps outer current plus 5      $mod+Shift+period		gaps outer current minus 5      $mod+comma		      gaps inner current plus 5 diff --git a/dotfiles/.config/sxiv/exec/key-handler b/dotfiles/.config/sxiv/exec/key-handler index 6e17c5a..8fa1bdb 100755 --- a/dotfiles/.config/sxiv/exec/key-handler +++ b/dotfiles/.config/sxiv/exec/key-handler @@ -2,9 +2,12 @@  while read file; do    case "$1" in -    "C-a") +    "C-a" | "C-1")        setbg "$file"        exit ;; +    "C-2") +      setbg "$file" "2" +      exit ;;      "C-s")        setbglblur "$file"        exit ;; 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 | 
