Add special case (hub) to tmux-sessionizer

This commit is contained in:
david pickle 2025-01-20 18:41:34 -06:00
parent 11d224b396
commit 5208cd48ee
4 changed files with 15 additions and 4 deletions

View File

@ -0,0 +1,5 @@
.tool-versions
*.swp
*.swo
.tmux-session-hydrate

View File

@ -4,6 +4,7 @@ local omitted_dirs=(
$HOME $HOME
$HOMEBOX $HOMEBOX
$DEVDIR $DEVDIR
$DEVDIR/git
) )
[[ ! ${omitted_dirs[(re)$(pwd)]} ]] && [[ ! ${omitted_dirs[(re)$(pwd)]} ]] &&
tmux new-window -d -n cmd && tmux new-window -d -n cmd &&

View File

@ -15,18 +15,22 @@ hydrate() {
} }
local search_dirs=( local search_dirs=(
$HOME
$HOMEBOX $HOMEBOX
$DEVDIR $DEVDIR
$DEVDIR/git
$DEVDIR/git/* $DEVDIR/git/*
) )
local selected_path='' local selected_path=''
[[ $# -eq 1 ]] && selected_path=$1 || [[ $# -eq 1 ]] && selected_path=$1 ||
selected_path=$(find $search_dirs -mindepth 1 -maxdepth 1 -type d | fzf) selected_path=$(
find $search_dirs -mindepth 1 -maxdepth 1 -type d |
(echo 'hub' && cat) |
fzf
)
[[ -z $selected_path ]] && exit 0 [[ -z $selected_path ]] && exit 0
local selected_name=$(basename "$selected_path" | tr . _) local selected_name=''
[[ "$selected_path" = "hub" ]] && selected_name="hub" && selected_path=$HOME ||
selected_name=$(basename "$selected_path" | tr . _)
! (tmux_session_exists $selected_name) && ! (tmux_session_exists $selected_name) &&
tmux new-session -d -s $selected_name -c $selected_path && tmux new-session -d -s $selected_name -c $selected_path &&

View File

@ -1 +1,2 @@
add numbers/letters to sort and run scripts in particular order add numbers/letters to sort and run scripts in particular order
add tmux sessionizer template(s) to copy/paste for common, non-default settings