diff --git a/.bin/tmux-projectinator b/.bin/tmux-projectinator index 247ed6b..2b00ef6 100755 --- a/.bin/tmux-projectinator +++ b/.bin/tmux-projectinator @@ -23,6 +23,16 @@ debug () { fi } +spinner() { + local s="⣾⣽⣻⢿⡿⣟⣯⣷" + local -i i=0 + while :; do + printf "%s\\r" "${s:$((i++%4)):1}" >&2 + sleep .1 + done + +} + open_local () { tmux send-keys "cd $PROJECT_PATH" Enter @@ -52,7 +62,12 @@ open_new_pane () { declare -A CUSTOM_SESSIONS CUSTOM_SESSIONS[Projects]=Halia -PROJECT_LIST=$(find ~/* -name .git -type d -prune 2>/dev/null) +spinner & +spinner_pid=$! + +PROJECT_LIST=$(find ~/* -name .git -type d -not -path "~/.*" -prune 2>/dev/null) + +kill $spinner_pid SELECTED=$(echo $PROJECT_LIST | sed 's/\/.git/\n/g' | sed "s/$(echo $HOME | sed 's/\//\\\//g')//" | cut -d'/' -f2- | fzf)