Öffnen Sie zunächst eine Terminator-Instanz, teilen Sie sie wie gewünscht in 4 Bereiche auf und speichern Sie sie als neues Layout (schließen Sie alle geöffneten Terminalfenster mit Ausnahme des Fensters, das Sie mit Ihrem neuen Profil eingerichtet haben). Für jede der vier Scheiben, einen benutzerdefinierten Befehl hinzufügen , sondern nur den Text hinzufügen COMMAND1
, COMMAND2
usw. Speicher , um das neue Layout foo
(oder was auch immer). An diesem Punkt sollte Ihr ~/.config/terminator/config
ungefähr so aussehen:
[global_config]
enabled_plugins = LaunchpadCodeURLHandler, APTURLHandler, LaunchpadBugURLHandler
focus = mouse
suppress_multiple_term_dialog = True
title_use_system_font = False
[keybindings]
[layouts]
[[default]]
[[[child0]]]
fullscreen = False
last_active_term = ad14f6cd-bcc3-4a80-9852-3fe64f7fc2eb
last_active_window = True
maximised = False
order = 0
parent = ""
size = 735, 474
title = sometitle
type = Window
[[foo]]
[[[child0]]]
fullscreen = False
last_active_term = 18ebf009-c427-4c2f-8017-78c379a72d31
last_active_window = True
maximised = False
order = 0
parent = ""
position = 2730:254
size = 735, 474
title = NAME-1
type = Window
[[[child1]]]
order = 0
parent = child0
position = 237
ratio = 0.5
type = VPaned
[[[child2]]]
order = 0
parent = child1
position = 368
ratio = 0.500680272109
type = HPaned
[[[child5]]]
order = 1
parent = child1
position = 368
ratio = 0.500680272109
type = HPaned
[[[terminal3]]]
command = COMMAND1
order = 0
parent = child2
profile = default
title = NAME-1
type = Terminal
uuid = 01e46a5a-0a12-4861-a81e-e376af6041a7
[[[terminal4]]]
command = COMMAND2
order = 1
parent = child2
profile = default
type = Terminal
uuid = 094d544d-944c-48a7-9960-00370253e799
[[[terminal6]]]
command = COMMAND3
order = 0
parent = child5
profile = default
type = Terminal
uuid = fe19f601-1963-4af7-8870-f90e289d3d27
[[[terminal7]]]
command = COMMAND4
order = 1
parent = child5
profile = default
type = Terminal
uuid = 18ebf009-c427-4c2f-8017-78c379a72d31
[plugins]
[profiles]
[[default]]
cursor_color = "#aaaaaa"
font = Monaco 11
scrollback_infinite = True
scrollback_lines = 5000
use_system_font = False
Ändern Sie nun Ihr Bash-Skript, um es COMMANDN
durch den eigentlichen Befehl zu ersetzen, den Sie ausführen müssen:
#!/bin/bash
## change these to whatever you actually need
command1="echo one; bash"
command2="echo two; bash"
command3="tail -f /var/log/messages; bash"
command4="top"
## Modify terminator's config
sed -i.bak "s#COMMAND1#$command1#; s#COMMAND2#$command2#; s#COMMAND3#$command3#; s#COMMAND4#$command4#;" ~/.config/terminator/config
## Launch a terminator instance using the new layout
terminator -l foo
## Return the original config file
mv ~/.config/terminator/config.bak ~/.config/terminator/config
Durch Ausführen dieses Skripts wird nun ein neues Terminalfenster mit 4 Fenstern geöffnet, in denen jeweils einer Ihrer Befehle ausgeführt wird.
Wichtig : Wenn der Befehl ausgeführt und dann beendet wird (im Gegensatz zu etwas, top
das ausgeführt wird, bis Sie ihn zum Stoppen anweisen), benötigen Sie COMMAN; bash
den Befehl, damit eine neue Shell gestartet wird. Andernfalls wird der Befehl ausgeführt und die Shell wird sofort beendet. Deshalb habe ich ; bash
nach jedem Befehl außer top
in y Skript.