summaryrefslogtreecommitdiff
path: root/init.d/tmux
diff options
context:
space:
mode:
authorAnna (navi) Figueiredo Gomes <navi@vlhl.dev>2023-05-04 10:01:34 -0300
committerAnna (navi) Figueiredo Gomes <navi@vlhl.dev>2023-05-04 10:01:34 -0300
commit31ee4472e897cbf0c3d61bd56bd5864f4507b659 (patch)
tree5b0a8af5189ea1b88a36e9b909f3933899d9a1cf /init.d/tmux
re-initial
Signed-off-by: Anna (navi) Figueiredo Gomes <navi@vlhl.dev>
Diffstat (limited to 'init.d/tmux')
-rwxr-xr-xinit.d/tmux18
1 files changed, 18 insertions, 0 deletions
diff --git a/init.d/tmux b/init.d/tmux
new file mode 100755
index 0000000..770a996
--- /dev/null
+++ b/init.d/tmux
@@ -0,0 +1,18 @@
+#!/sbin/openrc-run
+
+user=$(whoami)
+command="/usr/bin/tmux"
+command_args="new-session -s ${user} -t ${user} -d"
+pidfile="${XDG_RUNTIME_DIR:-RC_SVCDIR}/tmux.pid"
+description="Start a tmux session"
+
+start_post() {
+ tmux display-message -p '#{pid}' > ${pidfile}
+ for session in ${sessions}; do
+ tmux new-session -s ${session} -d
+ eval local commands="\${commands_${session}}"
+ for command in "${commands}"; do
+ tmux new-window -n "${session}":"${command}" "${command}"
+ done
+ done
+}