Start multiple apps running in shells split in one console
I need to start multiple apps running in shells and monitor their execution. Currently I have a main script that launches every apps in a new gnome-console but I would prefer to launch them all in the same window in split screens.
This post Multiple shells in one window explains how to use split screens with many type of console applications such as screen, terminator and byobu. This works fine manually but I would like to be able to start all my apps in a split screen console automatically from my main scrip. In the documentation from the tools mentioned above there was nothing I could fine to achieve this automatically from a script.
Any ideas?
You can make a custom screen config file that will open up multiple splits and launch your scripts in them. It would look something like this:
screen script1.sh # Open first screen and launch first script
split # Make second split
focus # Switch to second split
screen script2.sh # Open second screen and launch second script
split # Make third split
focus # Switch to third split
screen script3.sh # Open third screen and launch third script
Put this in a file called myscripts and launch screen with screen -c myscripts
. If you prefer vertical splits, just add -v to the split commands.
If you'd like a grid layout, try something like this:
screen script1.sh # Open first screen and launch first script
split -v # Make second split
focus # Switch to second split
screen script2.sh # Open second screen and launch second script
split # Make third split
focus # Switch to third split
screen script3.sh # Open third screen and launch third script
focus # Cycle back to first split
split # Split first split horizontally
focus # Switch to new split
screen script4.sh # Open fourth screen and launch fourth script