几周前我想出了如何使用自定义布局启动终结者,而不是手动创建它(通过使用terminator -l
)。现在我想启动终结器并让自定义布局的每个窗格自动连接到远程服务器(不幸的是我必须管理多个服务器)。有什么方法或任何脚本支持/语言可以做到这一点吗?
答案1
我的终结者配置如下所示:
[profiles]
[[default]]
# some settings
[[root]]
# some colour settings
use_custom_command = True
custom_command = sudo -i
exit_action = restart
[[lab]]
# some more colour settings
use_custom_command = True
custom_command = ssh -R 2022:localhost:22 lab
exit_action = restart
[[server]]
# some more colour settings
use_custom_command = True
custom_command = ssh server
exit_action = restart
[layouts]
[[default]]
[[[child0]]]
type = Window
order = 0
parent = ""
[[[child1]]]
labels = None, None, None, None
type = Notebook
order = 0
parent = child0
[[[terminal1]]]
profile = root
type = Terminal
order = 0
parent = child1
[[[terminal2]]]
profile = lab
type = Terminal
order = 1
parent = child1
[[[terminal3]]]
profile = server
type = Terminal
order = 2
parent = child1
[[[terminal4]]]
profile = default
type = Terminal
order = 3
parent = child1
通过将配置文件与 结合起来custom_command
,我在启动时获得四个选项卡,一个带有 root shell,两个打开 ssh 连接,第四个运行普通 shell。
这些选项记录在terminator_config(5)
联机帮助页