diff options
| author | Luke Smith <luke@lukesmith.xyz> | 2019-11-23 16:16:30 -0500 |
|---|---|---|
| committer | Luke Smith <luke@lukesmith.xyz> | 2019-11-23 16:16:30 -0500 |
| commit | a5e66ac4f45322b3665c944ba34d83b7db43ebc5 (patch) | |
| tree | bed315d0a7f2c180b3eb634ece3a6a2089cdeb6f /.local/bin/i3cmds/hover | |
| parent | 85d353d7963391cd66f23a3e99a66b8b58045e4c (diff) | |
| download | eibhear-a5e66ac4f45322b3665c944ba34d83b7db43ebc5.tar.gz eibhear-a5e66ac4f45322b3665c944ba34d83b7db43ebc5.tar.zst eibhear-a5e66ac4f45322b3665c944ba34d83b7db43ebc5.zip | |
merger of bin
Diffstat (limited to '.local/bin/i3cmds/hover')
| -rwxr-xr-x | .local/bin/i3cmds/hover | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/.local/bin/i3cmds/hover b/.local/bin/i3cmds/hover new file mode 100755 index 0000000..d02bbbc --- /dev/null +++ b/.local/bin/i3cmds/hover @@ -0,0 +1,14 @@ +#!/usr/bin/env sh +[ -z "$1" ] && exit # If $1 is left, hovers in the bottom left, if right, the bottom right +current=$(xdotool getwindowfocus) +newwidth=$(($(xdotool getdisplaygeometry | awk '{print $2}') / 3)) +newheight=$(($(xdotool getdisplaygeometry | awk '{print $1}') / 3)) +xdotool windowsize "$current" $newheight $newwidth +newsize=$(xdotool getwindowgeometry "$current" | grep Geometry | sed -e 's/x/ /g' | awk '{print $3}') +newwidth=$(xdotool getwindowgeometry "$current" | grep Geometry | grep -o " [0-9]*") + +case "$1" in + left) horizontal=0; vertical=$(($(xdotool getdisplaygeometry | awk '{print $2}') - newsize)) ;; + right) horizontal=$(($(xdotool getdisplaygeometry | awk '{print $1}') - newwidth)) ; vertical=$(($(xdotool getdisplaygeometry | awk '{print $2}') - newsize)) ;; +esac +xdotool windowmove "$current" $horizontal $vertical |
