diff --git a/README.org b/README.org index 59db04f..b190195 100644 --- a/README.org +++ b/README.org @@ -8,28 +8,29 @@ This is a basic demo where tdrop is used to turn the current window (emacs) into [[http://noctuid.github.io/tdrop/assets/current.gif]] * Advantages Over Other Dropdown Terminals -- Can be used with any terminal or other program of your choice -- Supports many WMs -- Allows turning any window into a dropdown on the fly -- Allows for control of sizing and placement so that panels aren't hidden -- Supports tiled and floating dropdowns -- Attempts to deal with floating windows on a case by case basis (ability to have a floating dropdown without needing a rule to float all windows of that type) -- Allows for multiple dropdowns of the same type (uses window id) -- Allows for auto-hiding a dropdown when opening programs from it -- Can automatically start programs and tmux or tmuxinator sessions -- Supports automatic resizing based on the current monitor -- Has hooks for executing user commands +- Can be used with any terminal or other program of your choice +- Supports many WMs +- Allows turning any window into a dropdown on the fly +- Allows for control of sizing and placement so that panels aren't hidden +- Supports tiled and floating dropdowns +- Attempts to deal with floating windows on a case by case basis (ability to have a floating dropdown without needing a rule to float all windows of that type) +- Allows for multiple dropdowns of the same type (uses window id) +- Allows for auto-hiding a dropdown when opening programs from it +- Can automatically start programs and tmux, tmuxinator, or tmuxifier sessions +- Supports automatic resizing based on the current monitor +- Has hooks for executing user commands * Requirements -- bash and basic utilities (awk, sed, etc.) -- xprop -- xwininfo -- xdotool +- bash and basic utilities (awk, sed, etc.) +- xprop +- xwininfo +- xdotool Optional: -- xrandr (for -m) -- tmux (for -s) -- tmuxinator (for -s) +- xrandr (required for -m) +- tmux (required for -s) +- tmuxinator (optional for -s) +- tmuxifier (optional for -s) * Installation Instructions and Usage ** Installation @@ -145,19 +146,19 @@ mime ^video, has mpv, X, flag f = tdrop -a auto_hide && mpv -- "$@" && tdrop -a ** Terminals These terminals have been tested with tdrop and support the =-s= and =-a= flags unless otherwise specified: -- Termite -- URxvt (including urxvtd) -- XTerm -- Xfce4-terminal -- Gnome-terminal -- Konsole -- Terminology -- Sakura -- Roxterm -- Tilix (previously terminix) -- st (-s does not work) -- Alacritty -- xiate +- Termite +- URxvt (including urxvtd) +- XTerm +- Xfce4-terminal +- Gnome-terminal +- Konsole +- Terminology +- Sakura +- Roxterm +- Tilix (previously terminix) +- st (-s does not work) +- Alacritty +- xiate If your terminal doesn't work with tdrop, feel free to make an issue. Please follow the steps in the [[#troubleshooting][Troubleshooting]] section. @@ -204,7 +205,7 @@ Necessary features don't work on many window managers, including mine. Maybe in the future. The only advantage I can see over xdotool is that it can toggle mapping (=mapw -t=), but this wouldn't be used in this script anyway since different code is executed depending on whether or not the window is mapped or unmapped. Also the command names are somewhat cryptic. * Similar -- [[https://github.com/lharding/lsh-bin/blob/master/drawer][drawer]] +- [[https://github.com/lharding/lsh-bin/blob/master/drawer][drawer]] * Troubleshooting :PROPERTIES: diff --git a/tdrop b/tdrop index b141bf3..56431a4 100755 --- a/tdrop +++ b/tdrop @@ -13,8 +13,8 @@ options: -w width specify a width for a newly created term (default: 100%) -x pos specify x offset for a newly created term (default: 0) -y pos specify y offset for a newly created term (default: 1, see man) - -s name name for tmux/tmuxinator session (supported terminal - required) + -s name name for tmux/tmuxinator/tmuxifier session (supported + terminal required) -n num num or extra text; only needed if for the purpose of using multiple dropdowns of same program -c cmd provide a pre-create command @@ -32,9 +32,9 @@ options: floating window; on applicable with auto_hide -f flags specify flags/options to be used when creating the term or window (e.g. -f '--title mytitle'; default: none). - Caution: if there is a tmux/tmuxinator session specified - (with -s), the option to execute a program (usually -e for - terminal programs) is implicitly added by tdrop + Caution: if there is a tmux session specified (with -s), the option + to execute a program (usually -e for terminal programs) is + implicitly added by tdrop -a automatically detect window manager and set relevant options (e.g. this makes specifying -l/-L, -d, and -i uneccessary for supported WMs) (default: false) @@ -559,6 +559,7 @@ program_start() { if [[ -n "$session_name" ]]; then session_name=$(printf "%q" "$session_name") tmux_command="'tmux attach-session -dt $session_name || \ + tmuxifier load-session $session_name || \ tmuxinator start $session_name || \ tmux new-session -s $session_name'" if [[ $program =~ ^(urxvt|alacritty|xiatec$) ]]; then diff --git a/tdrop.1 b/tdrop.1 index a988b81..e61dc3e 100644 --- a/tdrop.1 +++ b/tdrop.1 @@ -6,7 +6,7 @@ Tdrop - make dropdown terminals and windows .SH SYNOPSIS tdrop [\fIOPTIONS\fR] [program name or cmd] .SH DESCRIPTION - Tdrop is used for hiding/unhiding programs to acheive quake/dropdown functionality. It can create a dropdown window if one does not already exist or turn the current window into a dropdown on the fly. It provides options to control the intial size and position of dropdowns, for example to leave panels visible or to deal with window borders. When used with a terminal, it provides an option to specify the name of a tmuxinator or tmux session to automatically start. It also allows the user to specify arbitrary options/flags to be used when starting programs. It uses window IDs as opposed to classes, so it can be used with multiple windows of the same program. + Tdrop is used for hiding/unhiding programs to acheive quake/dropdown functionality. It can create a dropdown window if one does not already exist or turn the current window into a dropdown on the fly. It provides options to control the intial size and position of dropdowns, for example to leave panels visible or to deal with window borders. When used with a terminal, it provides an option to specify the name of a tmux session to automatically start. It also allows the user to specify arbitrary options/flags to be used when starting programs. It uses window IDs as opposed to classes, so it can be used with multiple windows of the same program. It also has the ability to automatically hide and automatically show dropdowns. For example, it can be used to automatically hide a terminal when opening something from it, e.g. an image viewer, video player, etc. Tdrop can then automatically bring back the terminal whenever the image view, video player, etc. is closed. See the Examples section for more information. .SH Commands @@ -36,7 +36,7 @@ Specify the x position for a created window as a number or percentage. (default: Specify the y position for a created window as a number or percentage. (default: 1, see BUGS) .TP \fB-s NAME\fR, \fB --session=NAME\fR -Specify a tmuxinator or tmux session name to start. An existing tmux session has highest precedence and will be connected to with '-d', detaching other attached clients. If a there is no tmuxinator session of the given name, a normal tmux session with the name will be created. If this option is not given, tmux will not be used. Note that this option requires that the program be a supported terminal. (default: none) +Specify a tmuxinator, tmuxifier, or tmux session name to start. An existing tmux session has highest precedence and will be connected to with '-d', detaching other attached clients. If a there is no tmuxinator/tmuxifier/etc. session of the given name, a normal tmux session with the name will be created. If this option is not given, tmux will not be used. Note that this option requires that the program be a supported terminal. (default: none) .TP \fB-n NUMBER\fR, \fB --number=NUMBER\fR Specify a number (or any extra text) to differentiate between dropdowns of the same program (this is only needed when using multiple dropdowns of the same program). This flag can also be used for creating multiple different dropdowns on the fly ('current'). Note that it is not necessary to use this to deal with multi-user systems as tdrop stores dropdown information separately for each user. (default: none) @@ -75,7 +75,7 @@ This option is a more complicated companion to -d that is also unlikely to be ne Specify a command that will determine whether the current window is floating ($wid can be used in the command instead). Only used for the auto_hide command. This will be used to save whether the current window is floating or not. When restoring the window, if there is a float command and the window was previously floating, it will be floated. (default: none) .TP \fB-f\fR, \fB --program-flags\fR -Specify flags/options that the terminal or program should be called with. For example, to set the title of the terminal, something like '-f "--title mytitle"' can be used. Caution: If there is a tmux/tmuxinator session specified (with -s), the option to execute a program (usually -e for terminal programs) is implicitly added by tdrop! (default: none) +Specify flags/options that the terminal or program should be called with. For example, to set the title of the terminal, something like '-f "--title mytitle"' can be used. Caution: If there is a tmux session specified (with -s), the option to execute a program (usually -e for terminal programs) is implicitly added by tdrop! (default: none) .TP \fB-a\fR, \fB --auto-detect-wm\fR If there are available settings for the detected window manager for the -l, -L, -d, and/or -i options, automatically set them. Takes no argument. Manually specified settings take precedence. This can be used both for dropdowns and the auto_(hide|show) commands. Takes no argument. (default: false) @@ -123,7 +123,7 @@ Tdrop supports controlling the initial size and placement of a terminal. The bor .br $ tdrop -a -w 1362 -y 14 xterm -Tdrop can also create a tmux or tmuxinator session if it does not exist: +Tdrop can also create a tmux session if it does not exist: .br $ tdrop -a -w 1362 -y 14 -s dropdown xterm