Wednesday, May 1, 2024
7
rated 0 times [  7] [ 0]  / answers: 1 / hits: 8314  / 1 Year ago, wed, february 8, 2023, 7:25:53

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?


More From » command-line

 Answers
2

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

[#44584] Friday, February 10, 2023, 1 Year  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
fishutt

Total Points: 391
Total Questions: 137
Total Answers: 106

Location: Mexico
Member since Tue, Aug 11, 2020
4 Years ago
;