diff options
author | Toby Vincent <tobyv13@gmail.com> | 2023-06-26 14:37:43 -0500 |
---|---|---|
committer | Toby Vincent <tobyv13@gmail.com> | 2023-06-26 14:38:03 -0500 |
commit | 16a6146742f23ad5bf2cdff1c910b1ac4bba6a30 (patch) | |
tree | 1147a3594364c6318e82cc6a09490eaf22b80e44 /tmux/.local/bin/tmux-sessionizer | |
parent | 67adb402c414439c7c9037762ee4a758a822a0aa (diff) |
refactor(tmux): rename scripts
Diffstat (limited to 'tmux/.local/bin/tmux-sessionizer')
-rwxr-xr-x | tmux/.local/bin/tmux-sessionizer | 33 |
1 files changed, 0 insertions, 33 deletions
diff --git a/tmux/.local/bin/tmux-sessionizer b/tmux/.local/bin/tmux-sessionizer deleted file mode 100755 index 8dcbabc..0000000 --- a/tmux/.local/bin/tmux-sessionizer +++ /dev/null @@ -1,33 +0,0 @@ -#!/bin/sh - -if [ "$#" -eq 0 ]; then - GIT_PREVIEW='onefetch --include-hidden {}' - DIR_PREVIEW='tree -CL 3 --gitignore --noreport --filelimit=50 {}' - PREVIEW_CMD="($GIT_PREVIEW || $DIR_PREVIEW) 2>/dev/null" - - # shellcheck disable=2046 - set -- $( - projectr -mgt ~/src ~/pkg ~/dkr ~/doc -P ~/.dotfiles --exclude-cwd | - fzf-tmux "$FZF_TMUX_OPTS" -- --tac --select-1 --exit-0 -d/ --with-nth -2.. \ - --bind 'focus:transform-header(echo {})' \ - --preview-window='right,75%,<80(up,75%,border-bottom)' --preview="$PREVIEW_CMD" - ) - - test -n "$1" || exit 0 -fi - -if [ -z "$2" ]; then - if [ -z "$(tmux list-sessions -f "#{==:#{session_path},$1}" -F '#S' 2>/dev/null)" ]; then - tmux new-session -dc "$1" - fi - - set -- "$1" "$(tmux list-sessions -f "#{==:#{session_path},$1}" -F '#S' 2>/dev/null)" -elif ! tmux has-session -t "$2" 2>/dev/null; then - tmux new-session -dc "$1" -s "$2" -fi - -if [ -z "$TMUX" ] && [ -z "$2" ]; then - tmux attach-session -t "$2" -elif tmux has-session -t "$2" 2>/dev/null; then - tmux switch-client -t "$2" -fi |