summaryrefslogtreecommitdiff
path: root/herbstluftwm/mvrs.sh
diff options
context:
space:
mode:
authorMatias Linares <matiaslina@openmailbox.org>2015-10-23 03:14:36 -0300
committerMatias Linares <matiaslina@openmailbox.org>2015-10-23 03:14:36 -0300
commit5b132bf1244a008ad3ce67688030a7678831f77d (patch)
tree501aa27e89f81d5f4bdfaab31c72378991a9c749 /herbstluftwm/mvrs.sh
downloaddotfiles-5b132bf1244a008ad3ce67688030a7678831f77d.tar.gz
Initial commit
Diffstat (limited to 'herbstluftwm/mvrs.sh')
-rwxr-xr-xherbstluftwm/mvrs.sh36
1 files changed, 36 insertions, 0 deletions
diff --git a/herbstluftwm/mvrs.sh b/herbstluftwm/mvrs.sh
new file mode 100755
index 0000000..f7b3c14
--- /dev/null
+++ b/herbstluftwm/mvrs.sh
@@ -0,0 +1,36 @@
+#!/bin/bash
+
+# ./mvrs WINID X Y Width Height
+
+floating=$(herbstclient get_attr tags.focus.floating)
+
+if [[ x"$floating" == xfalse ]]
+then
+ resizestep=0.02
+ herbstclient resize $1 $2
+else
+ resizestep=15
+ winid="$(herbstclient get_attr clients.focus.winid)"
+
+ width=$(xwininfo -id "${winid}" | grep Width | awk '{print $2}')
+ height=$(xwininfo -id "${winid}" | grep Height | awk '{print $2}')
+
+ case $1 in
+ left)
+ width=$(($width - ${resizestep}))
+ ;;
+ right)
+ width=$(($width + ${resizestep}))
+ ;;
+ up)
+ height=$(($height - ${resizestep}))
+ ;;
+ down)
+ height=$(($height + ${resizestep}))
+ ;;
+ esac
+
+
+ ~/.config/herbstluftwm/bin/mvrs ${winid} $width $height
+fi
+