From 543fe65065482b46594d0680f20475773c0e8b2b Mon Sep 17 00:00:00 2001 From: Daniel Napora Date: Thu, 20 May 2021 14:45:43 +0200 Subject: [PATCH] upd --- bin/snapwin | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) mode change 100644 => 100755 bin/snapwin diff --git a/bin/snapwin b/bin/snapwin old mode 100644 new mode 100755 index f14d89b..a36d7fd --- a/bin/snapwin +++ b/bin/snapwin @@ -1,8 +1,8 @@ #!/bin/bash -### snapwin - click on the appropriate area of the window to snap it in a given direction. -# Works with active and inactive windows. -# Same actions are available for kebindings: topleft, top, topright, left, center, right, -# bottomleft, bottom and bottomright. +#: snapwin - click on the appropriate area of the window to snap it in a given direction. +#: Works with active and inactive windows. +#: Same actions are available for kebindings: topleft, top, topright, left, center, right, +#: bottomleft, bottom and bottomright. # Copyright (C) Daniel Napora 2021 # https://maboxlinux.org # @@ -136,10 +136,13 @@ moveto() { POS_CODE="$1" _movewin } - +usage() { + grep "^#:" $0 | while read DOC; do printf '%s\n' "${DOC###:}"; done + exit +} case "$1" in "") clicksnap ;; topleft|top|topright|left|center|right|bottomleft|bottom|bottomright) moveto "$1" ;; - *) usage ;; + -h|--help) usage ;; esac