From 8e93ac0facc933c2f0940fbfeb09a6a59f46227e Mon Sep 17 00:00:00 2001 From: david Date: Fri, 4 Apr 2025 16:55:39 -0500 Subject: [PATCH] Adjust tmux-sessionizer key-binds and filenames --- src_files/.config/tmux/tmux.conf | 9 +++++---- ...mux-session-hydrate => .tmux-session-hydrate-default} | 0 src_files/.local/bin/tmux-sessionizer | 3 ++- 3 files changed, 7 insertions(+), 5 deletions(-) rename src_files/.local/bin/{.tmux-session-hydrate => .tmux-session-hydrate-default} (100%) diff --git a/src_files/.config/tmux/tmux.conf b/src_files/.config/tmux/tmux.conf index 003ec37..bd36364 100644 --- a/src_files/.config/tmux/tmux.conf +++ b/src_files/.config/tmux/tmux.conf @@ -22,12 +22,13 @@ bind r source-file "~/.config/tmux/tmux.conf" \; display-message "tmux.conf relo # kill the current session bind-key Q rename-session zzzz-temp-kill\; switch-client -p\; kill-session -t zzzz-temp-kill -bind-key W kill-session +bind-key W kill-session # TODO: if i can combine this into the above when only 1 session remains, do so -# custom find using tmux-sessionizer +# custom find and switching for sessions using tmux-sessionizer unbind-key f -bind-key f run-shell "tmux neww ~/.local/bin/tmux-sessionizer existing" -bind-key F run-shell "tmux neww ~/.local/bin/tmux-sessionizer" +bind-key f run-shell "tmux neww ~/.local/bin/tmux-sessionizer" +bind-key F run-shell "tmux neww ~/.local/bin/tmux-sessionizer existing" +bind-key H run-shell "tmux neww ~/.local/bin/tmux-sessionizer hub" # bind -r D neww -c "#{pane_current_path}" "[[ -e TODO.md ]] && $EDITOR TODO.md || $EDITOR ~/personal/dev/todo.md" diff --git a/src_files/.local/bin/.tmux-session-hydrate b/src_files/.local/bin/.tmux-session-hydrate-default similarity index 100% rename from src_files/.local/bin/.tmux-session-hydrate rename to src_files/.local/bin/.tmux-session-hydrate-default diff --git a/src_files/.local/bin/tmux-sessionizer b/src_files/.local/bin/tmux-sessionizer index c350365..fe8ea7c 100755 --- a/src_files/.local/bin/tmux-sessionizer +++ b/src_files/.local/bin/tmux-sessionizer @@ -5,8 +5,9 @@ switch_to() { } hydrate() { - local tmux_hydrate_path="$HOME/.local/bin/.tmux-session-hydrate" + local tmux_hydrate_path="$HOME/.local/bin/.tmux-session-hydrate-default" [[ -f $2/.tmux-session-hydrate ]] && tmux_hydrate_path="$2/.tmux-session-hydrate" + # TODO: add special case: [[ "$1" = "hub" ]] && tmux_hydrate_path="$HOME/.local/bin/.tmux-session-hydrate-hub" [[ -f $tmux_hydrate_path ]] && tmux send-keys -t $1 "source $tmux_hydrate_path" c-M }