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
-n num num or extra text; only needed if want multiple dropdowns of same program (default: "")
-n num num or extra text; only needed if want multiple dropdowns of same program (default: "")
-p cmd provide a pre-map command to float the window if necessary
-p cmd provide a pre-map command to float the window if necessary
-P cmd provide a post-map command to float the window if necessary
-P cmd provide a post-map command to float the window if necessary
-M cmd provide a post-unmap command; can be used for example with a window manager that doesn't support floating to turn fullscreen on when mapping a terminal then off when unmapping it
-O cmd provide a one time command only for when a dropdown is created/initiated (useful for 'tdrop -c')
-O cmd provide a one time command only for when a dropdown is created/initiated (useful for 'tdrop -c')
-d XxY give decoration/border size to accurately save position; only applicable with auto_show; on applicable with a few window managers (e.g. blackbox)
-d XxY give decoration/border size to accurately save position; only applicable with auto_show; on applicable with a few window managers (e.g. blackbox)
-a automatically detect window manager and if settings exist for it, automatically set -p, -P, and -d values as necessary; this can have affect when used with a terminal or with auto_show or auto_hide (default: false)
-a automatically detect window manager and if settings exist for it, automatically set -p, -P, and -d values as necessary; this can have affect when used with a terminal or with auto_show or auto_hide (default: false)
@ -47,6 +48,7 @@ xoff=0
yoff=1
yoff=1
map_pre=""
map_pre=""
map_post=""
map_post=""
unmap_post=""
oneshot_post=""
oneshot_post=""
session_name=""
session_name=""
num=""
num=""
@ -66,6 +68,7 @@ do
n) num=$OPTARG;;
n) num=$OPTARG;;
p) map_pre=$OPTARG;;
p) map_pre=$OPTARG;;
P) map_post=$OPTARG;;
P) map_post=$OPTARG;;
M) unmap_post=$OPTARG;;
O) oneshot_post=$OPTARG;;
O) oneshot_post=$OPTARG;;
d) dec_fix=$OPTARG;;
d) dec_fix=$OPTARG;;
W) normal_window=true;;
W) normal_window=true;;
@ -82,6 +85,7 @@ do
number) num=$OPTARG;;
number) num=$OPTARG;;
pre-command) map_pre=$OPTARG;;
pre-command) map_pre=$OPTARG;;
post-command) map_post=$OPTARG;;
post-command) map_post=$OPTARG;;
post-unmap) unmap_post=$OPTARG;;
oneshot-post) oneshot_post=$OPTARG;;
oneshot-post) oneshot_post=$OPTARG;;
decoration-fix) dec_fix=$OPTARG;;
decoration-fix) dec_fix=$OPTARG;;
normal-window) normal_window=true;;
normal-window) normal_window=true;;
@ -173,6 +177,12 @@ map_post_command() {
fi
fi
}
}
unmap_post_command() {
if [[ -n $unmap_post ]]; then
eval "$unmap_post"
fi
}
maybe_cancel_auto_show() {
maybe_cancel_auto_show() {
if $cancel_auto_show && [[ $1 == "$(< /tmp/tdrop/auto_hidden/wid)" ]]; then
if $cancel_auto_show && [[ $1 == "$(< /tmp/tdrop/auto_hidden/wid)" ]]; then
@ -42,6 +42,9 @@ Specify a command to execute before showing/mapping a dropdown. This may be usef
\fB\-P\fR, \fB \-\-post-command\fR
\fB\-P\fR, \fB \-\-post-command\fR
Specify a command to execute after showing/mapping a dropdown. This may be useful in the case where a window manager does not support floating rules or floating altogether. It can be used, for example, to fake a key combo to float the current window. (default: none)
Specify a command to execute after showing/mapping a dropdown. This may be useful in the case where a window manager does not support floating rules or floating altogether. It can be used, for example, to fake a key combo to float the current window. (default: none)
.TP
.TP
\fB\-M\fR, \fB \-\-post-unmap\fR
Specify a command to execute after unmapping a dropdown. This can be used with window managers that don't support floating in conjunction with '--pre-command' to, for example, change the layout to fullscreen when mapping a dropdown and then revert it when umapping it. (default: none)
.TP
\fB\-O\fR, \fB \-\-oneshot-post\fR
\fB\-O\fR, \fB \-\-oneshot-post\fR
Specify a post command to execute only when first creating or initiating a dropdown. This can be used when turning the current window into a dropdown to float and resize it. (default: none)
Specify a post command to execute only when first creating or initiating a dropdown. This can be used when turning the current window into a dropdown to float and resize it. (default: none)
.TP
.TP
@ -52,7 +55,7 @@ Specify a window decoration/border size in the form <x decoration size>x<y decor
Specifies that the program is not a terminal or does not have the '-e' flag; takes no argument. If using 'tdrop current', this option will have no effect either way. (default: false)
Specifies that the program is not a terminal or does not have the '-e' flag; takes no argument. If using 'tdrop current', this option will have no effect either way. (default: false)
.TP
.TP
\fB\-a\fR, \fB \-\-auto-detect-wm\fR
\fB\-a\fR, \fB \-\-auto-detect-wm\fR
If there are available settings for the detected window manager for the -p, -P, and/or -d options, automatically set them; takes no argument. User set settings will still override these. This can be used with 'tdrop <terminal>', 'tdrop auto_hide', and 'tdrop auto_show'. For 'auto_hide', if the window manager is supported, it will check if the current window is tiled so that it is not changed to floating when auto-showing. (default: false)
If there are available settings for the detected window manager for the -p, -P, -M, and/or -d options, automatically set them; takes no argument. User set settings will still override these. This can be used with 'tdrop <terminal>', 'tdrop auto_hide', and 'tdrop auto_show'. For 'auto_hide', if the window manager is supported, it will check if the current window is tiled so that it is not changed to floating when auto-showing. (default: false)
.TP
.TP
\fB \-\-clear\fR
\fB \-\-clear\fR
Used to clear a saved window id for the given program or 'current' instead of creating a dropdown; takes no argument.
Used to clear a saved window id for the given program or 'current' instead of creating a dropdown; takes no argument.