aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/tmux/.local/bin/tmux-sessionizer
diff options
context:
space:
mode:
Diffstat (limited to 'tmux/.local/bin/tmux-sessionizer')
-rwxr-xr-xtmux/.local/bin/tmux-sessionizer33
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