From c1653570665ad0b08436f5cff71fcf13ef2f1aec Mon Sep 17 00:00:00 2001 From: thek4n Date: Fri, 10 Oct 2025 18:08:42 +0300 Subject: [PATCH] add tmux session --- .gitignore | 1 + home/user/.tmux/system-update | 19 +++++++++++++++++++ 2 files changed, 20 insertions(+) create mode 100755 home/user/.tmux/system-update 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}"