From 6fd2f58f6cc964f695709fe0d99c92ce2723555b Mon Sep 17 00:00:00 2001 From: thek4n Date: Sun, 13 Oct 2024 18:03:13 +0300 Subject: [PATCH] tmux session managment --- home/user/.config/tmux/mappings.conf | 11 +---------- home/user/.tmux/01.sh | 18 ------------------ home/user/.tmux/10.sh | 16 ---------------- 3 files changed, 1 insertion(+), 44 deletions(-) delete mode 100755 home/user/.tmux/01.sh delete mode 100755 home/user/.tmux/10.sh diff --git a/home/user/.config/tmux/mappings.conf b/home/user/.config/tmux/mappings.conf index ff1ae6e..832854c 100644 --- a/home/user/.config/tmux/mappings.conf +++ b/home/user/.config/tmux/mappings.conf @@ -188,13 +188,4 @@ bind -T copy-mode-vi WheelDownPane select-pane \; send-keys -X -N 2 scroll-down # Session managment -bind 1 run-shell ~/.tmux/01.sh -bind 2 run-shell ~/.tmux/02.sh -bind 3 run-shell ~/.tmux/03.sh -bind 4 run-shell ~/.tmux/04.sh -bind 5 run-shell ~/.tmux/05.sh -bind 6 run-shell ~/.tmux/06.sh -bind 7 run-shell ~/.tmux/07.sh -bind 8 run-shell ~/.tmux/08.sh -bind 9 run-shell ~/.tmux/09.sh -bind 0 run-shell ~/.tmux/10.sh \ No newline at end of file +bind f display-popup -EE '"$HOME/.tmux/$(ls ~/.tmux/*.sh | xargs -n 1 basename | fzf +m)"' \ No newline at end of file diff --git a/home/user/.tmux/01.sh b/home/user/.tmux/01.sh deleted file mode 100755 index b4c077f..0000000 --- a/home/user/.tmux/01.sh +++ /dev/null @@ -1,18 +0,0 @@ -#!/usr/bin/env bash - -set -x - -SESSION=dotfiles -MAINW=1 - -WORKING_PROJECT="$HOME/dotfiles" - -if ! tmux has-session -t "$SESSION"; then - tmux new-session -s "$SESSION" -d -n "$MAINW" -c "$WORKING_PROJECT" - tmux splitw -t "$SESSION:$MAINW" -d -b -h -l "$_tmux_other_pane_size" -c '#{pane_current_path}' - tmux send-keys -t "$SESSION:$MAINW.1" "git pull && git push" Enter - tmux send-keys -t "$SESSION:$MAINW.2" '$EDITOR' Enter - tmux send-keys -t "$SESSION:$MAINW.2" ':Telescope find_files' Enter -fi - -tmux switch-client -t "$SESSION" \ No newline at end of file diff --git a/home/user/.tmux/10.sh b/home/user/.tmux/10.sh deleted file mode 100755 index 8d38460..0000000 --- a/home/user/.tmux/10.sh +++ /dev/null @@ -1,16 +0,0 @@ -#!/usr/bin/env bash - -set -x - -SESSION="sandbox${RANDOM}" -MAINW=1 - -WORKING_PROJECT="$(mktemp -d)" - -tmux new-session -s "$SESSION" -d -n "$MAINW" -c ~ -tmux splitw -t "$SESSION:$MAINW" -d -b -h -l "$_tmux_other_pane_size" -c '#{pane_current_path}' - -tmux new-window -d -n "2" -t "$SESSION:2" -c "$WORKING_PROJECT" -tmux splitw -t "$SESSION:2" -d -b -h -l "$_tmux_other_pane_size" -c "$WORKING_PROJECT" -tmux send-keys -t "$SESSION:2.1" 'git clone .' Left Left -tmux switch-client -t "$SESSION" \ No newline at end of file