I would like to open a terminal, split it to lets say 9 parts (3×3) and execute some bash script. But for each terminal part different script.
Can this be done using perl, python or even bash?
How can I switch between those little terminals without using keyboard shortcuts?
Oh, by the way, I'm using terminator
. And if there is some other terminal emulator that enables such a functionality, which is it?
Best Answer
To plagiarize myself, you can set up a profile with your desired settings (instructions adapted from here):
Run
terminator
, and set up the layout you want. You can use Ctrl+Shift+E to split windows vertically and Ctrl+Shift+O (that's O as in oodles, not zero) to split horizontally. For this example, I have created a layout with 6 panes:Right click on the
terminator
window and chose "Preferences". Once the Preferences window is open, go to "Layouts" and click "Add":That will populate the Layout list with your new layout:
Find each of the terminals you have created in the layout, and click on them, then on the right enter the command you want to run in them on startup:
IMPORTANT: Note that the command is followed by
; bash
. If you don't do that the terminals will not be accessible since they will run the command you give and exit. You need to launch a shell after each command to be able to use the terminals.Once you have set all the commands click "Close" and then exit
terminator
.Open the
terminator
config file~/.config/terminator/config
and delete the section under layouts for the default config. Then change the name of the layout you created to default. It should look something like this:The final result is that when you run
terminator
it will open with 6 panes, each of which has run or is running the commands you have specified:Also, you can set up as many different profiles as you wish and either launch terminator with the
-p
switch giving a profile name, or manually switch to whichever profile you want after launching.