winm

A simple script for window mgmt on xfce4
Log | Files | Refs | README

commit 5ffa9e41697f3e60e7d2248d5333e377496d31ac
parent 794abf243ec9f17432c537d9723bb91249675fe5
Author: Naveen Narayanan <zerous@nocebo.space>
Date:   Sun,  7 Jul 2024 04:01:21 +0200

Add moveright and moveleft func

Regardless of setting exact co-ordinates xdotool doesn't seem to honor
them specifically. Moving right along an axis isn't possible since
movement along x changes y inadvertently. Perhaps, this is due to some
kind of quantization issues.

Diffstat:
Mxfce4wm | 44+++++++++++++++++++++++++++++++++++---------
1 file changed, 35 insertions(+), 9 deletions(-)

diff --git a/xfce4wm b/xfce4wm @@ -219,32 +219,58 @@ function win_growhoriz { xdotool getactivewindow windowsize $((w+100)) $h } +function win_moveright { + eval $(xwininfo -id $(xdotool getactivewindow) | + sed -n -e "s/^ \+Absolute upper-left X: \+\([0-9]\+\).*/x=\1/p" \ + -e "s/^ \+Absolute upper-left Y: \+\([0-9]\+\).*/y=\1/p" \ + -e "s/^ \+Width: \+\([0-9]\+\).*/w=\1/p" \ + -e "s/^ \+Height: \+\([0-9]\+\).*/h=\1/p" ) + #echo -n "$x $y $w $h" + xdotool getactivewindow windowmove --sync $((x+25)) 0 +} + +function win_moveleft { + eval $(xwininfo -id $(xdotool getactivewindow) | + sed -n -e "s/^ \+Absolute upper-left X: \+\([0-9]\+\).*/x=\1/p" \ + -e "s/^ \+Absolute upper-left Y: \+\([0-9]\+\).*/y=\1/p" \ + -e "s/^ \+Width: \+\([0-9]\+\).*/w=\1/p" \ + -e "s/^ \+Height: \+\([0-9]\+\).*/h=\1/p" ) + #echo -n "$x $y $w $h" + xdotool getactivewindow windowmove --sync $((x-25)) 0 +} + for command in ${@} ; do - if [[ "$command" == 'tile' ]] + if [[ "$command" == 'tile' ]] then win_tile - elif [[ "$command" == 'select' ]] + elif [[ "$command" == 'select' ]] then win_select - elif [[ "$command" == 'tiletwo' ]] + elif [[ "$command" == 'tiletwo' ]] then win_tile_two - elif [[ "$command" == 'cascade' ]] + elif [[ "$command" == 'cascade' ]] then win_cascade - elif [[ "$command" == 'showdesktop' ]] + elif [[ "$command" == 'showdesktop' ]] then win_showdesktop - elif [[ "$command" == 'growvertical' ]] + elif [[ "$command" == 'growvertical' ]] then win_growvert - elif [[ "$command" == 'growhorizontal' ]] + elif [[ "$command" == 'growhorizontal' ]] then win_growhoriz - elif [[ "$command" == 'shrinkhorizontal' ]] + elif [[ "$command" == 'shrinkhorizontal' ]] then win_shrinkhoriz - elif [[ "$command" == 'shrinkvertical' ]] + elif [[ "$command" == 'moveright' ]] + then + win_moveright + elif [[ "$command" == 'moveleft' ]] + then + win_moveleft + elif [[ "$command" == 'shrinkvertical' ]] then win_shrinkvert fi