Skip to content

Instantly share code, notes, and snippets.

@rvedotrc
Last active August 29, 2015 14:18
Show Gist options
  • Save rvedotrc/60c82a21ca1c49da0fdd to your computer and use it in GitHub Desktop.
Save rvedotrc/60c82a21ca1c49da0fdd to your computer and use it in GitHub Desktop.
First, a script to ensure tmux is running how we like it:
$ cat start-tmux
#!/bin/bash
if ! tmux has-session -t irssi >/dev/null 2>&1 ; then
tmux -2 new-session -d -n irssi -s irssi irssi
fi
if ! tmux has-session -t irssi; then
echo "Failed to start irssi tmux session"
fi
Run it at boot time:
$ crontab -l
@reboot ./start-tmux 2>&1 | logger -t start-tmux
Auto-launch into that tmux session for interactive sessions, via ~/.profile:
if [ ! "${TMUX:-}" ] ; then
./start-tmux
tmux attach -t irssi
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment