For most WMs (awesome is an exception), windows that are open on another
desktop are reported as unmapped which causes nothing to happen if a
tdrop command is run (unmapping/mapping don't work in this case). Moving
a dropdown to the current desktop is possible with xdotool though
(basically the same as wmctrl's -R). This is a temporary solution that
may be need to be refined in the future. A potential issue is whether
pre/post map hooks should be run in this case (e.g. rules should not be
added again for bspwm). This could be fixed later by actually unmapping
the window or by adding more specific hooks. Addresses #21.
- Simplify logic
- Properly handle both the case where a "special" program needs to be
started and where it has already been started (did not actually work
before because the first pgrep somehow stopped the second from working
correctly)
- Add support for "chromium-browser"
Closes#20.
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".