![如何设置 Terminator 启动时标签的默认布局/配置文件?](https://linux22.com/image/846047/%E5%A6%82%E4%BD%95%E8%AE%BE%E7%BD%AE%20Terminator%20%E5%90%AF%E5%8A%A8%E6%97%B6%E6%A0%87%E7%AD%BE%E7%9A%84%E9%BB%98%E8%AE%A4%E5%B8%83%E5%B1%80%2F%E9%85%8D%E7%BD%AE%E6%96%87%E4%BB%B6%EF%BC%9F.png)
我的 Terminator 一开始采用的是 solarized-dark 布局,但当我打开新标签时,它使用默认布局。如何才能让任何标签都采用 solarized-dark 布局?
[global_config]
title_transmit_bg_color = "#d30102"
focus = system
[keybindings]
[profiles]
[[default]]
# solarized-dark
#palette = "#073642:#dc322f:#859900:#b58900:#268bd2:#d33682:#2aa198:#eee8d5:#002b36:#cb4b16:#586e75:#657b83:#839496:#6c71c4:#93a1a1:#fdf6e3"
#foreground_color = "#eee8d5"
#background_color = "#002b36"
#cursor_color = "#eee8d5"
[[solarized-dark]]
palette = "#073642:#dc322f:#859900:#b58900:#268bd2:#d33682:#2aa198:#eee8d5:#002b36:#cb4b16:#586e75:#657b83:#839496:#6c71c4:#93a1a1:#fdf6e3"
foreground_color = "#eee8d5"
background_color = "#002b36"
cursor_color = "#eee8d5"
[[solarized-light]]
palette = "#073642:#dc322f:#859900:#b58900:#268bd2:#d33682:#2aa198:#eee8d5:#002b36:#cb4b16:#586e75:#657b83:#839496:#6c71c4:#93a1a1:#fdf6e3"
background_color = "#eee8d5"
foreground_color = "#002b36"
cursor_color = "#002b36"
[layouts]
[[default]]
[[[child1]]]
type = Terminal
parent = window0
profile = solarized-dark
[[[window0]]]
type = Window
parent = ""
[plugins]
答案1
您的终结器以 solarized-dark 布局开始,因为您的第一个子项的布局配置是这样指定的。
[layouts]
[[default]]
[[[child1]]]
...
profile = solarized-dark
如果您想将 solarized-dark 设为默认配置文件,请更改配置文件的默认配置(您可以复制/粘贴或重命名您当前的 solarized-dark 配置文件为默认值)
[profiles]
[[default]]
# solarized-dark
palette = "#073642:#dc322f:#859900:#b58900:#268bd2:#d33682:#2aa198:#eee8d5:#002b36:#cb4b16:#586e75:#657b83:#839496:#6c71c4:#93a1a1:#fdf6e3"
foreground_color = "#eee8d5"
background_color = "#002b36"
cursor_color = "#eee8d5"
理想情况下,我们可以选择在默认部分引用配置文件配置(而不必拥有副本),但据我所知这是不可能的。
PS:我不喜欢这个想法,always_split_with_profile = True
因为它强制继承配置文件,而这可能并不是在所有情况下都需要的。
答案2
只需确保always_split_with_profile = True
在你的配置文件中的[global_config]
部分下有。
这使得终结器在创建新的分割和/或标签时继承所选的配置文件。
要从一开始就选择不同的配置文件,请使用 调用它terminator -p solarized-dark
。
但要注意,因为在使用选项 [1]always_split_with_profile
时不被遵守。在这种情况下,你应该总是明确添加。--new-tab
-p