Jademalo
August 16th, 2012, 07:39 AM
I have been searching for about an hour, and I cant figure out how to do this.
I want to create a screen session called "JadeCraft" with 6 different windows
JadeCraft
JadeCraft Tekkit
JadeCraft TF2
Top
Temps
Shell
These are all invoked from scripts:
bash /home/scotty/Scripts/runme.sh
bash /home/scotty/Scripts/runmetekkit.sh
cd hlds && cd ga* && cd or* && ./srcds_run -game tf -autoupdate -maxplayers 32 -ip 192.168.16.10 +map mvm_coaltown
top
bash /home/scotty/Scripts/tempwatch.sh
empty
Now, what I am wanting to do is make a script that I can run that will automatically create a screen session with that content in it. So far, I have managed to get one window going:
screen -d -m -S JadeCraft -t JadeCraft
screen -S JadeCraft -p JadeCraft -X exec bash /home/scotty/Scripts/runme.sh
screen -S JadeCraft -p 1 -X exec bash /home/scotty/Scripts/runmetekkit.sh
Now obviously, this doesn't work. The last line does nothing, but it does create a single window with runme.sh running.
The first problem I run into is I can't seem to create another screen window from a script. So I need to figure out how to do that. I also need to figure out how to give that the correct title.
I was thinking something along the lines of this for the third line:
screen -S JadeCraft -t "JadeCraft Tekkit" -p "JadeCraft Tekkit" -X exec bash /home/scotty/Scripts/runmetekkit.sh
However obviously it 1. Doesn't work, and 2. has nothing in there that says it's making a new window.
I know you can invoke commands on spesific windows using -p (Either 1-9 or the name of the window) but I need to create that window first before it does anything.
tl;dr
How can I get screen to create multiple windows with individual names from a single script that I run on startup?
I want to create a screen session called "JadeCraft" with 6 different windows
JadeCraft
JadeCraft Tekkit
JadeCraft TF2
Top
Temps
Shell
These are all invoked from scripts:
bash /home/scotty/Scripts/runme.sh
bash /home/scotty/Scripts/runmetekkit.sh
cd hlds && cd ga* && cd or* && ./srcds_run -game tf -autoupdate -maxplayers 32 -ip 192.168.16.10 +map mvm_coaltown
top
bash /home/scotty/Scripts/tempwatch.sh
empty
Now, what I am wanting to do is make a script that I can run that will automatically create a screen session with that content in it. So far, I have managed to get one window going:
screen -d -m -S JadeCraft -t JadeCraft
screen -S JadeCraft -p JadeCraft -X exec bash /home/scotty/Scripts/runme.sh
screen -S JadeCraft -p 1 -X exec bash /home/scotty/Scripts/runmetekkit.sh
Now obviously, this doesn't work. The last line does nothing, but it does create a single window with runme.sh running.
The first problem I run into is I can't seem to create another screen window from a script. So I need to figure out how to do that. I also need to figure out how to give that the correct title.
I was thinking something along the lines of this for the third line:
screen -S JadeCraft -t "JadeCraft Tekkit" -p "JadeCraft Tekkit" -X exec bash /home/scotty/Scripts/runmetekkit.sh
However obviously it 1. Doesn't work, and 2. has nothing in there that says it's making a new window.
I know you can invoke commands on spesific windows using -p (Either 1-9 or the name of the window) but I need to create that window first before it does anything.
tl;dr
How can I get screen to create multiple windows with individual names from a single script that I run on startup?