diff --git a/.gitignore b/.gitignore index 60304bb..8dd2c64 100644 --- a/.gitignore +++ b/.gitignore @@ -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 diff --git a/home/user/.tmux/system-update b/home/user/.tmux/system-update new file mode 100755 index 0000000..72754da --- /dev/null +++ b/home/user/.tmux/system-update @@ -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}"