add tmux-select command

This commit is contained in:
Ray Elliott 2020-04-11 17:59:22 +01:00
parent 64abacbd58
commit 4caf5ab35e
1 changed files with 13 additions and 0 deletions

13
src/tmux-select Executable file
View File

@ -0,0 +1,13 @@
#!/bin/sh
_dmenu_config="$HOME/.config/dmenu/dmenurc"
_sessions="$(tmux ls | cut -d: -f1)"
if [ -f "$_dmenu_config" ] ; then
# dmenu options will now be stored in $DMENU_OPTIONS
. "$_dmenu_config"
fi
_session=$(echo "$_sessions" | dmenu $DMENU_OPTIONS -i -p "Tmux session:")
[ -z "$_session" ] || terminal-dev tmux attach -t $_session