如何让终结器使用自定义命令以我的自定义布局启动?

如何让终结器使用自定义命令以我的自定义布局启动?

类似于这个:如何让 Terminator 以我的自定义布局启动?

如果我没有向任何终端添加任何自定义命令,我可以让我从 ubuntu 14.04 存储库安装的 terminator 0.97 以自定义布局正确启动。如果我向任何一个或多个终端添加自定义命令,它将仅启动并显示未添加任何自定义命令的终端。

例如,如果我将sleep 5;ls命令添加到布局中的四个终端之一,它将显示 4 个终端窗口,持续 5 秒,5 秒后其中一个将消失。

v@v-MS-7599:~/.config/terminator$ cat config
[global_config]
  enabled_plugins = CustomCommandsMenu, LaunchpadCodeURLHandler, APTURLHandler, LaunchpadBugURLHandler
  suppress_multiple_term_dialog = True
[keybindings]
[profiles]
  [[default]]
    use_system_font = False
    autoclean_groups = False
    background_darkness = 0.91
    scrollback_lines = 2000
    background_type = transparent
    background_image = None
    show_titlebar = False
    font = Monospace 16
  [[new]]
    background_image = None
[layouts]
  [[default]]
    [[[child1]]]
      type = Terminal
      parent = window0
      profile = default
      command = ""
    [[[window0]]]
      type = Window
      parent = ""
  [[test2]]
    [[[child0]]]
      position = 426:218
      type = Window
      order = 0
      parent = ""
      size = 1042, 643
    [[[child1]]]
      position = 321
      type = VPaned
      order = 0
      parent = child0
    [[[child2]]]
      position = 521
      type = HPaned
      order = 0
      parent = child1
    [[[child5]]]
      position = 521
      type = HPaned
      order = 1
      parent = child1
    [[[terminal3]]]
      profile = default
      type = Terminal
      order = 0
      parent = child2
      command = ""
    [[[terminal4]]]
      profile = default
      type = Terminal
      order = 1
      parent = child2
      command = ""
    [[[terminal7]]]
      profile = default
      type = Terminal
      order = 1
      parent = child5
      command = sleep 5; df -h
    [[[terminal6]]]
      profile = new
      type = Terminal
      order = 0
      parent = child5
      command = ""
[plugins]
  [[CustomCommandsMenu]]
    [[[/window 6]]]
      command = /window 6
      enabled = True
      name = /window 6
    [[[/window 7]]]
      command = /window 7
      enabled = True
      name = /window 7
    [[[/window 5]]]
      command = /window 5
      enabled = True
      name = /window 5
    [[[/window next]]]
      command = /window next
      enabled = True
      name = /window next
    [[[/window previous]]]
      command = /window previous
      enabled = True
      name = /window previous
    [[[/window 11]]]
      command = /window 11
      enabled = True
      name = /window 11
    [[[/window 8]]]
      command = /window 8
      enabled = True
      name = /window 8
    [[[/window 9]]]
      command = /window 9
      enabled = True
      name = /window 9
    [[[/window 10]]]
      command = /window 10
      enabled = True
      name = /window 10
    [[[alt+4]]]
      command = /window 4
      enabled = True
      name = alt+4
    [[[/window 12]]]
      command = /window 12
      enabled = True
      name = /window 12
    [[[alt+1]]]
      command = /window 1
      enabled = True
      name = alt+1
    [[[alt+1 ei]]]
      command = "xte 'keydown Alt_L' 'key 1' 'keyup Alt_L'"
      enabled = False
      name = alt+1 ei
    [[[alt+3]]]
      command = /window 3
      enabled = True
      name = alt+3
    [[[alt+2]]]
      command = /window 2
      enabled = True
      name = alt+2

这里 http://pastebin.com/UTmhiBGH这是使用 -d 标志运行此类布局时的日志文件。我不确定我是否使用了上述配置。运行此命令时,该命令或另一个类似命令可能在另一个终端上,但结果总是相似的。

另外,我已将 LayoutManager.py 插件放到 /usr/share/terminator/terminatorlib/plugins 中,但是它似乎也不起作用,然而PluginRegistry::load_plugins: Importing plugin LayoutManager.py failed: invalid syntax (LayoutManager.py, line 5) error.这个自定义命令问题从一开始就存在。

答案1

当您运行自定义命令并退出时,终端会关闭,因为命令已完成。对于您的自定义命令,请使用单独的配置文件。在该配置文件的“命令”选项卡中,您需要将“命令退出时:”组合更改为“保持终端打开”。

相关内容