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
- Use window id to float windows, so that the wrong window isn't ever
accidentally floated
- Sleep when first creating window to ensure it is mapped before
resizing/floating
Before, using the -a option with bspwm would float any window after
auto-hiding then auto-showing it. This will prevent non-floating windows that are auto hidden from being
floated afterwards.
unmapping a dropdown
can be used, for example in a tiling wm, with -p or -P to toggle fullscreen on for just a
dropdown then off when unmapping the dropdown
Originally tried parsing xwininfo's -geometry section output with awk, but signs (+/-) change depending on window position.
Instead, subtract relative from absolute if they are different.
On window managers with decorations/borders they will be different.
if there is no saved window id, xwininfo -id will be run without an
argument and will wait for the user to click on a window; prevent this
from happening
initial script commit
- remove xdo dependency
- make tmux usage optional
- only toggle by wid (removed generic class toggle)
- generalize script to work with more than just terminals
- generalize script to not be tied to bspwm
- add -p and -P flags for window manager specific oneshot floating rules
or commands
- add a bspwm tested command for -p
- add work-around for urxvt's different -e option
- add long options
- make y-offset default to 1 so that windows aren't moved to center
- add -n flag to allow for multiple dropdowns of same terminal
- update help