terminator 使用

terminator 是一个多窗口的控制台管理器( terminal multiplexer ),类似 tmux, 不过是在 GUI 下用的, 通过它我们可以很方便的切割多个控制台窗口,分类任务,充分地利用屏幕空间,使桌面下的工作效率大大提高.

layout

由于我们需要打开许多 console ,所以才需要 terminator ,但每次开启都要手工去建好 tab 和 window ,再进入不同的工作路径等等,而 terminator提供了 layout 的功能,能够满足我们的一键还原 console 工作环境的需求, 通过实操感受一下:

1. 新建一个 layout

首先,我们先建立好想要的窗口布局,然后进入 Preferences -> layout tab
点击左下角 Add 一个Layout File, 并命名为 work1 ,这个 layout 内容就是当前的布局。

2. 查看 & 编辑配置文件

vim ~/.config/terminator/config
[global_config]
inactive_color_offset = 0.74
title_transmit_fg_color = "#fbebeb"
[keybindings]
[profiles]
[[default]]
background_darkness = 0.73
palette = "#000000:#aa0000:#00aa00:#aa5500:#0000aa:#aa00aa:#00aaaa:#aaaaaa:#555555:#ff5555:#55ff55:#ffff55:#5555ff:#ff55ff:#55ffff:#ffffff"
background_type = transparent
background_image = None
foreground_color = "#00ff00"
[layouts]
[[default]]
[[[child1]]]
type = Terminal
parent = window0
profile = default
[[[window0]]]
type = Window
parent = ""
[[work01]]
[[[child0]]]
position = 45:24
type = Window
order = 0
parent = ""
size = 1871, 904
[[[child1]]]
labels = localhost, servers
type = Notebook
order = 0
parent = child0
[[[child2]]]
position = 438
type = VPaned
order = 0
parent = child1
[[[child3]]]
position = 934
type = HPaned
order = 0
parent = child2
[[[child6]]]
position = 934
type = HPaned
order = 1
parent = child2
[[[child13]]]
position = 934
type = HPaned
order = 1
parent = child9
[[[child9]]]
position = 446
type = VPaned
order = 1
parent = child1
[[[child10]]]
position = 934
type = HPaned
order = 0
parent = child9
[[[terminal11]]]
profile = default
type = Terminal
order = 0
parent = child10
[[[terminal12]]]
profile = default
type = Terminal
order = 1
parent = child10
[[[terminal5]]]
profile = default
type = Terminal
order = 1
parent = child3
[[[terminal4]]]
profile = default
type = Terminal
order = 0
parent = child3
[[[terminal7]]]
profile = default
type = Terminal
order = 0
parent = child6
[[[terminal15]]]
profile = default
type = Terminal
order = 1
parent = child13
[[[terminal8]]]
profile = default
type = Terminal
order = 1
parent = child6
[[[terminal14]]]
profile = default
type = Terminal
order = 0
parent = child13
[plugins]

找到work01的节点,改名为default,原先的default改名为default_bak

然后关闭重新打开terminator,可以发现自动打开了两个tab,分割成四个窗口,但是

3. 增加 command

这一步可以编辑 ~/.config/terminator/config 文件(如果不嫌麻烦),也可以通过Preference修改。

通过Preference方式修改:

找到Terminal,将sslocal -c /etc/ss.json ; bash填入Custom command,其他同理。重新打开

重新打开terminator, perfect。每个上午都可以愉悦的开始一天的工作!

最后附上修改后的配置文件:

[global_config]
inactive_color_offset = 0.74
title_transmit_fg_color = "#fbebeb"
[keybindings]
[profiles]
[[default]]
background_darkness = 0.73
palette = "#000000:#aa0000:#00aa00:#aa5500:#0000aa:#aa00aa:#00aaaa:#aaaaaa:#555555:#ff5555:#55ff55:#ffff55:#5555ff:#ff55ff:#55ffff:#ffffff"
background_type = transparent
background_image = None
foreground_color = "#00ff00"
[layouts]
[[default]]
[[[child0]]]
position = 45:24
type = Window
order = 0
parent = ""
size = 1871, 904
[[[child1]]]
labels = localhost, servers
type = Notebook
order = 0
parent = child0
[[[child2]]]
position = 438
type = VPaned
order = 0
parent = child1
[[[child3]]]
position = 934
type = HPaned
order = 0
parent = child2
[[[child6]]]
position = 934
type = HPaned
order = 1
parent = child2
[[[child13]]]
position = 934
type = HPaned
order = 1
parent = child9
[[[child9]]]
position = 446
type = VPaned
order = 1
parent = child1
[[[child10]]]
position = 934
type = HPaned
order = 0
parent = child9
[[[terminal11]]]
profile = default
type = Terminal
order = 0
parent = child10
command = cd ~/dev/tools/servers/ ; bash
[[[terminal12]]]
profile = default
type = Terminal
order = 1
parent = child10
command = ""
[[[terminal5]]]
profile = default
type = Terminal
order = 1
parent = child3
command = top; bash
[[[terminal4]]]
profile = default
type = Terminal
order = 0
parent = child3
command = sslocal -c /etc/ss.json ; bash
[[[terminal7]]]
profile = default
type = Terminal
order = 0
parent = child6
command = cd ~/dev/git_repos/HexoBlog/hexo-hello/; bash
[[[terminal15]]]
profile = default
type = Terminal
order = 1
parent = child13
command = ""
[[[terminal8]]]
profile = default
type = Terminal
order = 1
parent = child6
command = cd ~/dev/git_repos/Java/MavenProj/; bash
[[[terminal14]]]
profile = default
type = Terminal
order = 0
parent = child13
command = ""
[[default_bak]]
[[[child1]]]
type = Terminal
parent = window0
profile = default
[[[window0]]]
type = Window
parent = ""
[plugins]

参考


【1】http://askubuntu.com/questions/158159/how-do-i-get-terminator-to-start-up-with-my-custom-layout