diff options
author | Yaroslav <contact@yaroslavps.com> | 2020-09-10 09:48:36 +0300 |
---|---|---|
committer | Yaroslav <contact@yaroslavps.com> | 2020-09-10 09:48:36 +0300 |
commit | db6706d3211ba2841140ec0a7101d9b740b86363 (patch) | |
tree | 1681eb8fe2c4a48ba5514f29ec2053f03c4e2326 /dotfiles | |
parent | 3f4a4f3cb9401772df85532314c9dfc2723bf619 (diff) | |
download | swayrice-db6706d3211ba2841140ec0a7101d9b740b86363.tar.gz swayrice-db6706d3211ba2841140ec0a7101d9b740b86363.zip |
swayresize: resize amount
* Resize by a custom amount of pixels; Default is 2 pixels.
* Added shortcut to sway config to resize by 10 pixels.
Diffstat (limited to 'dotfiles')
-rw-r--r-- | dotfiles/.config/sway/config | 6 | ||||
-rwxr-xr-x | dotfiles/.local/bin/swayresize | 5 |
2 files changed, 11 insertions, 0 deletions
diff --git a/dotfiles/.config/sway/config b/dotfiles/.config/sway/config index ba88469..7939442 100644 --- a/dotfiles/.config/sway/config +++ b/dotfiles/.config/sway/config @@ -4,6 +4,7 @@ # Set mod key (Mod1=<Alt>, Mod4=<Super>) set $mod Mod4 +set $alt Mod1 set $term termite set $browser "qutebrowser" @@ -326,10 +327,15 @@ bindsym --to-code { # Shut down, restart and locking features $mod+Shift+e exec menusession + # Resize $mod+Shift+y exec --no-startup-id swayresize left $mod+Shift+u exec --no-startup-id swayresize down $mod+Shift+i exec --no-startup-id swayresize up $mod+Shift+o exec --no-startup-id swayresize right + $mod+Ctrl+y exec --no-startup-id swayresize left 10 + $mod+Ctrl+u exec --no-startup-id swayresize down 10 + $mod+Ctrl+i exec --no-startup-id swayresize up 10 + $mod+Ctrl+o exec --no-startup-id swayresize right 10 # Lock screen $mod+x exec --no-startup-id lock-color diff --git a/dotfiles/.local/bin/swayresize b/dotfiles/.local/bin/swayresize index 9ae94c0..89368e9 100755 --- a/dotfiles/.local/bin/swayresize +++ b/dotfiles/.local/bin/swayresize @@ -1,9 +1,14 @@ #!/bin/sh # This script was made by `goferito` on Github. # Some cleanup by Luke. +# Some improvements by Yaroslav. [ -z "$1" ] && echo "No direction provided" && exit 1 + distanceStr="2 px or 2 ppt" +if [ -n "$2" ]; then + distanceStr="$(printf "%s px or %s ppt" "$2" "$2")" +fi moveChoice() { swaymsg resize "$1" "$2" "$distanceStr" | grep '"success":true' || \ |