voidrice/.scripts/i3cmds/i3resize

28 lines
519 B
Text
Raw Normal View History

2018-10-04 17:59:39 +00:00
#!/bin/sh
2018-05-23 05:55:06 +00:00
# This script was made by `goferito` on Github.
2018-10-04 17:59:39 +00:00
# Some cleanup by Luke.
2018-05-23 05:55:06 +00:00
2018-10-04 17:59:39 +00:00
[ -z "$1" ] && echo "No direction provided" && exit 1
distanceStr="2 px or 2 ppt"
2018-05-23 05:55:06 +00:00
2018-10-04 17:59:39 +00:00
moveChoice() {
i3-msg resize "$1" "$2" "$distanceStr" | grep '"success":true' || \
i3-msg resize "$3" "$4" "$distanceStr"
2018-05-25 04:26:22 +00:00
}
2018-10-04 17:59:39 +00:00
case $1 in
2018-05-25 04:26:22 +00:00
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
2018-05-23 05:55:06 +00:00