master
Daniel Napora 2021-05-20 14:45:43 +02:00
parent 70ede2f318
commit 543fe65065
1 changed files with 9 additions and 6 deletions

15
bin/snapwin 100644 → 100755
View File

@ -1,8 +1,8 @@
#!/bin/bash #!/bin/bash
### snapwin - click on the appropriate area of the window to snap it in a given direction. #: snapwin - click on the appropriate area of the window to snap it in a given direction.
# Works with active and inactive windows. #: Works with active and inactive windows.
# Same actions are available for kebindings: topleft, top, topright, left, center, right, #: Same actions are available for kebindings: topleft, top, topright, left, center, right,
# bottomleft, bottom and bottomright. #: bottomleft, bottom and bottomright.
# Copyright (C) Daniel Napora <napcok@gmail.com> 2021 # Copyright (C) Daniel Napora <napcok@gmail.com> 2021
# https://maboxlinux.org # https://maboxlinux.org
# #
@ -136,10 +136,13 @@ moveto() {
POS_CODE="$1" POS_CODE="$1"
_movewin _movewin
} }
usage() {
grep "^#:" $0 | while read DOC; do printf '%s\n' "${DOC###:}"; done
exit
}
case "$1" in case "$1" in
"") clicksnap ;; "") clicksnap ;;
topleft|top|topright|left|center|right|bottomleft|bottom|bottomright) moveto "$1" ;; topleft|top|topright|left|center|right|bottomleft|bottom|bottomright) moveto "$1" ;;
*) usage ;; -h|--help) usage ;;
esac esac