Help with 'Terminator' config, or any tool

2019-09-01 19:31发布

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.

标签: terminator
4条回答
【Aperson】
2楼-- · 2019-09-01 20:23

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.

查看更多
劳资没心,怎么记你
3楼-- · 2019-09-01 20:29

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
查看更多
Bombasti
4楼-- · 2019-09-01 20:30

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

查看更多
Rolldiameter
5楼-- · 2019-09-01 20:34

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.

查看更多
登录 后发表回答