1
0
Fork 0
mirror of https://github.com/pnx/dotfiles synced 2026-06-16 03:14:55 +02:00

scripts/tmuxs: select session with -a flag

This commit is contained in:
Henrik Hautakoski 2024-08-11 12:07:04 +02:00
parent 51b5d4750f
commit 8ea00b5708

View file

@ -1,9 +1,13 @@
#!/usr/bin/env bash #!/usr/bin/env bash
if [[ $# -eq 1 ]]; then 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 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) selected=$(find ${DIRECTORIES} -mindepth 1 -maxdepth 1 -type d | fzf)
fi fi