add tmux session
This commit is contained in:
parent
ccc217d191
commit
c165357066
1
.gitignore
vendored
1
.gitignore
vendored
@ -36,6 +36,7 @@ home/user/.tmux/*
|
||||
!home/user/.tmux/sandbox
|
||||
!home/user/.tmux/ssh
|
||||
!home/user/.tmux/example-background-job
|
||||
!home/user/.tmux/system-update
|
||||
|
||||
home/user/.config/git/local
|
||||
|
||||
|
||||
19
home/user/.tmux/system-update
Executable file
19
home/user/.tmux/system-update
Executable file
@ -0,0 +1,19 @@
|
||||
#!/bin/sh
|
||||
|
||||
set -eux
|
||||
|
||||
readonly SESSION='system-update'
|
||||
readonly MAINW=1
|
||||
|
||||
readonly WORKING_PROJECT="${HOME}"
|
||||
|
||||
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" "sudo pacman -Syu --noconfirm"
|
||||
tmux send-keys -t "${SESSION}:${MAINW}.2" '$EDITOR' Enter
|
||||
sleep 0.5
|
||||
tmux send-keys -t "${SESSION}:${MAINW}.2" ':Lazy' Enter
|
||||
fi
|
||||
|
||||
tmux switch-client -t "${SESSION}"
|
||||
Loading…
x
Reference in New Issue
Block a user