summaryrefslogtreecommitdiff
path: root/init.d/tmux
blob: 770a996ba2dbd7865893c9435591648173488cf3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
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
}