mirror of
https://codeberg.org/frosty/dotfiles.git
synced 2024-09-19 03:37:10 -04:00
18 lines
448 B
Bash
Executable file
18 lines
448 B
Bash
Executable file
#!/bin/sh
|
|
|
|
SEARCH_DIRECTORIES="$HOME/documents/repos"
|
|
|
|
# shellcheck disable=SC2086
|
|
selected="$(find $SEARCH_DIRECTORIES -maxdepth 1 -type d | fzf)" || exit 0
|
|
|
|
if [ -z "$TMUX" ] && [ -z "$(pidof -sx tmux)" ]; then
|
|
tmux new-session -s "${selected##*/}" -c "$selected"
|
|
exit 0
|
|
fi
|
|
|
|
if ! tmux has-session -t="${selected##*/}" 2>/dev/null; then
|
|
tmux new-session -ds "${selected##*/}" -c "$selected"
|
|
fi
|
|
|
|
tmux switch-client -t "${selected##*/}"
|