tmux sessions
This commit is contained in:
parent
5423cd1bd1
commit
c12dd2d0fa
7
.gitignore
vendored
7
.gitignore
vendored
@ -28,6 +28,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/*
|
||||||
!home/user/.tmux/dotfiles.sh
|
!home/user/.tmux/dotfiles
|
||||||
!home/user/.tmux/temp.sh
|
!home/user/.tmux/temp
|
||||||
|
!home/user/.tmux/ssh
|
||||||
18
home/user/.tmux/dotfiles
Executable file
18
home/user/.tmux/dotfiles
Executable file
@ -0,0 +1,18 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
set -x
|
||||||
|
|
||||||
|
readonly SESSION=dotfiles
|
||||||
|
readonly MAINW=1
|
||||||
|
|
||||||
|
readonly 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}"
|
||||||
@ -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"
|
|
||||||
14
home/user/.tmux/ssh
Executable file
14
home/user/.tmux/ssh
Executable file
@ -0,0 +1,14 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
echo -n "ssh server: "
|
||||||
|
declare SSH_SERVER
|
||||||
|
read -r SSH_SERVER
|
||||||
|
readonly SSH_SERVER
|
||||||
|
|
||||||
|
readonly SESSION="ssh-${SSH_SERVER}"
|
||||||
|
|
||||||
|
if ! tmux has-session -t "${SESSION}"; then
|
||||||
|
tmux new-session -s "${SESSION}" -d -n "${MAINW}" -c "${WORKING_PROJECT}" "ssh ${SSH_SERVER}"
|
||||||
|
fi
|
||||||
|
|
||||||
|
tmux switch-client -t "${SESSION}"
|
||||||
Loading…
x
Reference in New Issue
Block a user