如何设置 Terminator 启动时标签的默认布局/配置文件?

如何设置 Terminator 启动时标签的默认布局/配置文件?

我的 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

[1]:https://bugs.launchpad.net/terminator/+bug/1283178“”

相关内容