Created
January 26, 2020 14:58
-
-
Save SofianeHamlaoui/52979c6ded181ed02d85ee4dc07e6857 to your computer and use it in GitHub Desktop.
I3 windows resizing without entering the resize mode
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env sh | |
[ -z "$1" ] && echo "No direction provided" && exit 1 | |
distanceStr="2 px or 2 ppt" | |
moveChoice() { | |
i3-msg resize "$1" "$2" "$distanceStr" | grep '"success":true' || \ | |
i3-msg resize "$3" "$4" "$distanceStr" | |
} | |
case $1 in | |
up) | |
moveChoice grow up shrink down | |
;; | |
down) | |
moveChoice shrink up grow down | |
;; | |
left) | |
moveChoice shrink right grow left | |
;; | |
right) | |
moveChoice grow right shrink left | |
;; | |
esac |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Brilliant, thanks.