As per the title. When I do
xdotool getactivewindow windowmove 0 0 windowsize 1200 $height_first_monitor
xdotool
moves the window. But when I do
xdotool getactivewindow windowmove -40 0 windowsize 1200 $height_first_monitor
I get a windowmove: unrecognized option '-40'
Google searches for "xdotool move above 0 0" and "xdotool move negative" and similar did not yield any useful results.
This would seem to be a bug, but from so long ago it might now be called a feature. To use negative numbers in certain places you will need to add the end-of-arguments marker
--
. For example, you can dobut you need to do
This is because windowmove can take optional arguments
--sync
and--relative
, but also (probably for backwards compatibility) the same with a single dash:-sync
and-relative
. Sadly,-10
is then mistaken for such an (unexpected) argument.Looking at the sources for windowmove, you can see it uses the standard C library function getopt_long_only(). This function looks for long arguments that begin
--
or-
. The alternativegetopt_long()
would just look for--
long arguments.I'm not sure if the above link is to the definitive sources, but this feature seems to be around from before 2010.