1

I have 3 different monitors hooked to my computer. I have 3 custom Terminator layouts. So far I have to manually open 3 different Terminator windows, move them to their respective monitors, switch them all to fullscreen and apply their respective layouts individually.

Is there a way I could automate this task? A shell script would certainly be able to do the trick. Since I have extremely rudimentary knowledge on shell scripting, could anyone point me to the necessary resources to do so? Or does anybody have a different take on it?

1 Answer 1

0

To open Terminator in a pre-defined layout you first need to define the layout. The configuration window can help you with that. You can also configure and name multiple different layouts there. I won't cover how to do that and focus on how to start Terminator with existing layouts upon log-in instead.

Start with a single Terminator layout and instance

Let's start simple with a single instance. I'll assume that you have a pre-defined Terminator layout named "simple-layout". You can start a new Terminator instance with this layout with the following command-line options:

terminator -l simple-layout

If you want a maximised, fullscreen or borderless window you can use suitable additional options as described in the Terminator manual (run man terminator to view it).

Run a single command at log-in

The general process is explained extensively in How do I start applications automatically on login? and I'm not going to repeat it here.

However there are some specifics in relation to Terminator: I found that Terminator only remembers its previous size position when it's launched once the window manager is fully running. That's why I delay the start by a few seconds (10 in this example). Instead of the above command I choose to auto-start the command:

sh -c "sleep 10 && exec terminator -l simple-layout"
  • sh -c invokes a (Bourne shell) command-interpreter that can execute multiple commands in sequence as explained below.
  • sleep 10 waits 10 seconds before running the next command.
  • exec replaces the current command-interpreter process with the subsequent program (instead of spawning an new process and wasting resources for no reason).
  • terminator ... – see above.

Now for multiple instances and layouts

At this point it should be trivial to repeat the process for additional Terminator instances and layouts. I'm not sure if Terminator will remember the position of each window of multiple instances. If not you should search around or ask a follow-up question and include your window manager in the question since that influences the answer.

1
  • As you’ve never accepted an answer before: if this answers your question, don’t forget to click the grey ☑ under the number at the left of this text to accept it, which means “yes, this answer is valid”! Mar 18, 2018 at 4:32

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .