Open frolovia opened 3 years ago
@frolovia
Looking through the code for:
ISRELA()
#define ISRELA(s) (s[0] == '+' || s[0] == '-')
I believe that if the string begins with a "+" or a "-" then the string is considered relative and will be added or subtracted from the current window position.
and
Perhaps the way X11 handles window move events has changed recently. I'm on KDE Plasma on Ubuntu 21.04, and I wasn't able to get this to work for me.
It works fine (if your not counting window titles and borders) with an absolute value like:
xdo move -y 200 -x 200
I was unable to get this to work correctly on KDE with relative values though.
xdo move -x "+5"
xdo move -x "-5"
I presume the author wrote this to work with bspwm and the window move logic isn't necessarily exactly compatible with other window managers.
I've had similar issues trying to handle relative window movement with xdotool and wmctrl
xdo move -x 200 -y 200
xdotool getactivewindow windowmove 200 200
wmctrl -r :ACTIVE -e "0,200,200,800,600"
So far the best way my research has turned up to do a window manager independent relative window move is the code in this post... Some testing shows it working for me, but I haven't wrapped it up in something useful yet.
You can get some windows to move relatively with xdotool
. For example, move the active window 10px left:
xdotool getactivewindow windowmove --sync --relative -- "-10" "0"
Unfortunately, this will not work on on all windows at least while running KDE.
Many windows have a Titlebar/Border visible area offset that doesn't match the rest of the window geometry, so moving a window horizontally actually moves it diagonally down the screen.
I'm looking into this in more detail, but it's a fairly complicated. Hopefully doesn't ultimately require integration with every window manager individually, because I would like to find a way do this only with XCB.
Would you please tell me how to set delta for move/resize action, but not position. E.g.: xdo move -x +1 #want to move +1 pixel from current to the right
Thanks!