Thursday, April 4, 2013

Screen: start multiple sessions/windows automatically

Say you want to regularly start up a screen session with a bunch of different commands running in windows. You can achieve this with a .screenrc file.
# Screen startup
# run with screen -c [filename]

# Import your regular screen settings
source ~/.screenrc

# When a process dies, if it was non-zero exit then keep the window until you
# hit 'q', if you hit 'r', run the same command again.
zombie qr onerror

screen -t vim /usr/bin/vim /code
screen -t tests
screen -t bash
screen -t monitoring /bin/some/montoring
Then just run it with
screen -c myscreenrc

No comments: