Help with 'Terminator' config, or any tool that can do the same functionality

社会主义新天地 提交于 2020-01-17 01:26:35

问题


During developing a project I had to open multiple tabs in gnome-terminal, some of them as just output streams, others for the shell prompt.

Is their a way to automate this task. Like running a script that automatically opens multiple terminals and run certain commands on each of them, and these terminals are displayed vertically or horizontally rather than in tabs ( or different windows ) like grid-display or something.

'Terminator' does exactly what I want, but I just can't configure it to work like what I want. I don't get the 'Layout' thing

Here's part of my 'config' file:

[layouts]
  [[default]]
    [[[child1]]]
      type = Terminal
      parent = window0
      position = left
   [[[child2]]]
      type = Terminal
      parent = window0
      position = left
   [[[window0]]]
      type = Window
      parent = ""

When I run terminator, an error is printed out saying that I there's an incorrect number of children, and then 'terminator' appears normally with a single terminal.

I don't know what I'm doing wrong here, I would appreciate any help with 'Terminator' or with any tool that has the same functionality.

Thanks.


回答1:


I think you have to try terminator a ruby gem that will help you to mange automation config files.

Terminitor automates your development workflow setup. Less time setting up, more time getting things done.

Also, an alternative is teamocil

Teamocil is a tool used to automatically create windows and splits in tmux with Ruby and YAML. Like tmuxinator, but with splits, not just windows.




回答2:


Did you consider using 'screen' ? there is a 'split' command.

  • "CTRL+a, S" (Capital S) to create a new tab
  • "CTRL+a, Tab" to Switch to this tab
  • "CTRL+a, c" to create a new screen in this tab



回答3:


Well, I suggest you to forget terminator (coming from a looong time terminator user) and learn to use a terminal multiplexer like tmux. There's a gem called tmuxinator that lets you configure sessions with YAML, so it's really, really easy.

For tmux I suggest you to start with the book «tmux: Productive Mouse-Free Development» from Brian Hoogan.




回答4:


I have been working on a shell script to do exactly what you need

https://github.com/vahidhedayati/terminator-win-splitter

chmod to 755

./termcon.sh -h

./termcon.sh -c {connects to existing layouts - press enter and it will list your existing layouts }

./termcon.sh -f filename.txt {connects to servers listing within filename.txt and stores layout }

./termcon.sh -l prod ta ce cex {LISTS auto discovered nodes for ce cex in production env which have tomcat or apache in naming } }

./termcon.sh -a prod ta ce cex {Connects to auto discovered nodes for ce cex in production env which have tomcat or apache in naming and stores layout}

I am still working on windows split, it is quite complex but for now it does a 4 window split with no issues, when it is working and i emailed again it will just be a case of

./termcon.sh -w 8 -a prod ta ce cex

./termcon.sh -w 8 -f file.txt

I would also recommend if calling via a file then to name files according to server naming convention since once a layout is stored it won't overwrite it



来源:https://stackoverflow.com/questions/6346765/help-with-terminator-config-or-any-tool-that-can-do-the-same-functionality

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!