2020-08-29 16:54:04 +02:00
|
|
|
#!/bin/sh
|
|
|
|
|
|
|
|
[ -z "$1" ] && exit # If $1 is left, hovers in the bottom left, if right, the bottom right
|
|
|
|
current=$(xdotool getwindowfocus)
|
2020-09-01 14:22:26 +02:00
|
|
|
newwidth=$(( 2 * $(xdotool getdisplaygeometry | awk '{print $1}') / 5))
|
|
|
|
newheight=$(( 2 * $(xdotool getdisplaygeometry | awk '{print $2}') / 5))
|
|
|
|
borderwidth=1
|
2020-08-29 16:54:04 +02:00
|
|
|
|
|
|
|
case "$1" in
|
|
|
|
left) horizontal=borderwidth;
|
|
|
|
vertical=$(($(xdotool getdisplaygeometry | awk '{print $2}') - newheight - 2 * borderwidth )) ;;
|
|
|
|
right) horizontal=$(($(xdotool getdisplaygeometry | awk '{print $1}') - newwidth - 2 * borderwidth ))
|
|
|
|
vertical=$(($(xdotool getdisplaygeometry | awk '{print $2}') - newheight - 2 * borderwidth )) ;;
|
|
|
|
esac
|
2020-10-28 13:48:43 +01:00
|
|
|
wmctrl -r :ACTIVE: -b remove,maximized_vert,maximized_horz
|
|
|
|
wmctrl -r :ACTIVE: -e 0,$horizontal,$vertical,$newwidth,$newheight
|
|
|
|
#xdotool windowsize "$current" $newwidth $newheight
|
|
|
|
#xdotool windowmove "$current" $horizontal $vertical
|