tmux session managment fix
This commit is contained in:
parent
76a911ffc9
commit
5423cd1bd1
7
.gitignore
vendored
7
.gitignore
vendored
@ -27,6 +27,7 @@ home/user/.termux/shell
|
|||||||
|
|
||||||
home/user/.config/tmux/plugins
|
home/user/.config/tmux/plugins
|
||||||
home/user/.config/tmux/local.conf
|
home/user/.config/tmux/local.conf
|
||||||
home/user/.tmux/*
|
|
||||||
!home/user/.tmux/01.sh
|
!home/user/.tmux/*
|
||||||
!home/user/.tmux/10.sh
|
!home/user/.tmux/dotfiles.sh
|
||||||
|
!home/user/.tmux/temp.sh
|
||||||
18
home/user/.tmux/dotfiles.sh
Executable file
18
home/user/.tmux/dotfiles.sh
Executable file
@ -0,0 +1,18 @@
|
|||||||
|
#!/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"
|
||||||
14
home/user/.tmux/temp.sh
Executable file
14
home/user/.tmux/temp.sh
Executable file
@ -0,0 +1,14 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
set -x
|
||||||
|
|
||||||
|
readonly RND="${RANDOM}"
|
||||||
|
readonly SESSION="sandbox${RND}"
|
||||||
|
|
||||||
|
|
||||||
|
declare WORKING_PROJECT
|
||||||
|
WORKING_PROJECT="$(mktemp -td "sandbox${RND}.XXXX")"
|
||||||
|
readonly WORKING_PROJECT
|
||||||
|
|
||||||
|
tmux new-session -s "${SESSION}" -d -c "${WORKING_PROJECT}"
|
||||||
|
tmux switch-client -t "${SESSION}"
|
||||||
Loading…
x
Reference in New Issue
Block a user