Commit Graph

83 Commits (702f047b6bdcc33c0b2353f490104458a171c310)

Author SHA1 Message Date
noctuid 702f047b6b Error in the case of multiple positional arguments 9 years ago
noctuid b472eda261 Use shift to simplify check for positional argument 9 years ago
noctuid 7442bf9b31 Deal with short options in positinal arg check 9 years ago
noctuid dadac198e2 Merge pull request #11 from schoettl/temp
Small enhancements
9 years ago
noctuid bf606ca510 Merge branch 'master' of https://github.com/noctuid/tdrop 9 years ago
noctuid 5a57a20aab Remove useless line 9 years ago
noctuid 3350752978 Add basic option validation
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
9 years ago
Jakob Schöttl 651404c5e3 Minor changes 9 years ago
noctuid a7a317d2ca Don't output xwininfo's errors for nonexistent WIDs 9 years ago
Jakob Schöttl 1b189759b9 Fix in documentation 9 years ago
noctuid 783cfc627a Merge branch 'wait' 9 years ago
noctuid c7b8ab343f Add support for urxvtd and terminix
Programs with a shared pid for all windows need to be treated
differently.
9 years ago
noctuid e07d993262 Get rid of sleep options
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
9 years ago
Jakob Schöttl 8cf2d6cc6a Avoid glob expansion on rhs and linter warning! 9 years ago
Jakob Schöttl 0c63e94588 Minor refactoring
Should have exactly the same effect now.

In case of no options: one white space after a shell command don't change
anything.
9 years ago
Jakob Schöttl 21e8aa2522 Fixed long-option argument parsing
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.
9 years ago
noctuid 8505a7bd97 Rename $term to $program 9 years ago
noctuid ef9e436252 Add initial support for terminix 9 years ago
noctuid f5c81e6acd Don't keep WIDs for windows that have been closed
Fixes a bug where the wrong window id could be used after creating a new
dropdown in the map_post_command or for set_geometry_for_monitor
9 years ago
noctuid 93b5947029 Make -m work on empty desktops for all WMs
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.
9 years ago
noctuid 6b099f93a4 Add documentation of -m option to README and rename long opt 9 years ago
noctuid a5bd168ce4 For -m, only get monitor info when creating and remapping
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".
9 years ago
noctuid 0a222a6ce0 Update bspwm is_floating command for new syntax
Bspc's query --tree command now outputs json. Maintain compatability
with old syntax as well.
9 years ago
noctuid e547e6fcd6 Maintain compatability with old bspc rule syntax 9 years ago
noctuid c194780856 Update bspwm map_pre command for new bspc syntax 9 years ago
noctuid 777a7d41bb Use -n when "returning" from a function with echo 9 years ago
noctuid c23c30ef65 Split some longer lines 9 years ago
noctuid 5dfe993943 Differentiate local variables from global variables 9 years ago
noctuid 0d369bef73 Determine monitor in better way on bspwm and i3
Addresses #3

This ensures that -m will work even when the focused workspace on a
monitor is empty.
9 years ago
noctuid babc97500e Set wm var for automatic settings in single location
(wm_autoset_for_hide_show (but not wm_autoset_for_dropdown) was taking
advantage of the fact that wm had already been set in wm_autoset_for_all)
9 years ago
noctuid aefa230d63 Prevent monitor checking for auto_hide and auto_show (doesn't do
anything)
9 years ago
noctuid b21f9b8add Add -f option to specify options for the terminal or other program to
be created using

Addresses #6
9 years ago
noctuid 8eed440432 Add missing sleep flags to getopts 9 years ago
noctuid b7e786c440 Fix -m for WMs where xrandr will identify one monitor as "primary" 9 years ago
noctuid 14495af417 Update -m to also set xoff and yoff appropriately
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
9 years ago
noctuid 6348276dbe Add multiple monitor support (automatic resizing and correct
width/height percentages)

Addresses #3
9 years ago
angelic-sedition b737354f22 Add support for Marco (MATE) 9 years ago
angelic-sedition 5cab6f4869 Add support for KWin (KDE) 9 years ago
angelic-sedition a777ea85e1 Reduce flicker and improve Muffin (Cinnamon) support
Fixes #2 and fixes #4
9 years ago
angelic-sedition b1e6977914 Add support for Mutter (Gnome Shell) 9 years ago
angelic-sedition 4cb2abd8bf Add options to set sleep time and fix fluxbox settings
Addresses #5
9 years ago
angelic-sedition 9c678fd203 Rename autoset functions for clarity 9 years ago
angelic-sedition c592541ad5 Fix auto_hide (and auto_show) bug that affected many WMs.
Further differentiate between how xwininfo behaves for different WMs.
This ensures that windows will be in the same position when
auto_showing.
9 years ago
angelic-sedition 867c3a97e2 Fix i3 auto_show bug
Previously would resize window when re-mapping; desired behaviour is to
keep previous size
9 years ago
angelic-sedition 271d991ce2 Add initial support for muffin (cinnamon)
Addresses #2
10 years ago
angelic-sedition aa0119bd2e Update documentation 10 years ago
angelic-sedition 1aa19c97fd Prevent irrelevant errors and info from appearing.
Addresses an issue mentioned in #1
10 years ago
angelic-sedition fc04c3c60a Improve i3 support; addresses issue mentioned in #1
- 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
10 years ago
angelic-sedition b584f00fd9 Fix bug where wasn't getting wid for newly created dropdowns
for potential use with a map_post_command. Also, don't use a
map_post_command when making the current window a dropdown and
instead unmap it.
10 years ago
angelic-sedition 07b526efed Accurately get correct window id for non-terminals
For some window managers, head -n 1 won't give the correct one
10 years ago