From 4caf5ab35e1829414b735c0954d1c120373191ff Mon Sep 17 00:00:00 2001 From: ray Date: Sat, 11 Apr 2020 17:59:22 +0100 Subject: [PATCH] add tmux-select command --- src/tmux-select | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100755 src/tmux-select diff --git a/src/tmux-select b/src/tmux-select new file mode 100755 index 0000000..525ac83 --- /dev/null +++ b/src/tmux-select @@ -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