With this, '-m' is no longer required for negative values to be used
with any of the geometry options (-w/-y/-x/-y). Also, tdrop no longer
relies on xdotool's ability to take percentages directly (for
windowsize). Fixes#19.
The map_post commands that actually combine movement with mapping will
cause an error when first creating a dropdown since in this case the
window is already mapped. Addresses #17.
This will, for example, allow session names to have whitespace (not that
that's a good idea, but if the session name is quoted like -s "a b",
then the expected behavior is to get a session named "a b" not for tdrop
to fail).
Exit with an error message if
- A long option that requires an arg is specified without =
- No positional argument is given (for the program name or auto commands)
- A negative width or height is given without -m
- Numeric options do not have a number value
Determine the WID of a created window by checking the WID(s) associated
with the PID until one is viewable. This allows tdrop to reliably
determine the WID of the programs it starts and prevents capturing the
wrong window.
- Combine wid_create and term_create into one (which removes the need
for the -W option)
- Remove differing sleep settings for various window managers
- Get rid of a loop to check if the WID has been found
Arguments of long-options (e.g. --program-flags='--foo=bar') may contain
equal sign characters (=). Before this fix, these kind of options were
split up into "program-flags" and "--foo" removing the last part of the
argument. This was because only the first two colums from `awk -F= ...`
were used.
Now these kind of options will be split up correctly using Bash parameter
expansion: "program-flags" and "--foo=bar".
See man bash > Parameter Expansion for details.
Tested with:
sudo cp tdrop /usr/bin/tdrop
tdrop -W --program-flags='-e tmux --role=tdropwindow' termite
tdrop -W -f '-e tmux --role=tdropwindow' termite
tdrop --normal-window -f '-e tmux --role=tdropwindow' termite
It also works for boolen long-option flags without argument. In this
case both OPTION and OPTARG are set to the long-option name. Boolean
options don't use the OPTARG so it doesn't matter.
When there is no active window, open the dropdown and use it to
determine the current monitor. This can result in delay before the
dropdown is resized. Closes#3.
Previously, if the dropdown was unmapped from another monitor and then
remapped on that monitor, the dropdown would not be resized since the
unmapping would change the stored "last_monitor".
This is apparently necessary for at least i3 when remapping a dropdown
and also for bspwm when first creating one (otherwise the dropdown will
be created at the absolute position xoff yoff even if it is not on the
current monitor).
Addresses #3