From 8ea00b5708c3ebcf94c8a2db7e11d749f445dbc2 Mon Sep 17 00:00:00 2001 From: Henrik Hautakoski Date: Sun, 11 Aug 2024 12:07:04 +0200 Subject: [PATCH] scripts/tmuxs: select session with -a flag --- scripts/tmuxs | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/scripts/tmuxs b/scripts/tmuxs index 5b1b18d..9194bf2 100755 --- a/scripts/tmuxs +++ b/scripts/tmuxs @@ -1,9 +1,13 @@ #!/usr/bin/env bash if [[ $# -eq 1 ]]; then - selected=$1 + if [[ "$1" -eq "-a" ]]; then + selected=$(tmux list-sessions | fzf | sed 's/: .*//g') + else + selected=$(realpath $1) + fi else - DIRECTORIES=$(cat ~/.tmuxs | sed "s&^\~&${HOME}&g") + DIRECTORIES=$(cat ~/.tmuxs | sed "s&^\~&${HOME}&g") selected=$(find ${DIRECTORIES} -mindepth 1 -maxdepth 1 -type d | fzf) fi