#!/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 }