Topic: Setting terminator's initial window size

On my computer, the default initial size of a terminator(1) window is about 70 characters across. Since the standard wrap length of source files, etc. seems to be about 79 characters, that is not a very useful size. I haven't found any menu or preference setting to change this, so have resorted to python hacking smile

By altering terminator's python launcher script at /usr/share/terminator/terminator, I managed to set a starting size which gives room for about 80 characters in my preferred font. Specifically, I added the following lines just below the import statements:

if not filter((lambda s: '--geometry' in s), sys.argv):
    sys.argv.append('--geometry=644')

A width of 644 pixels gives room for 80 characters on my screen and font. Of course, there are more elegant solutions, but this seems to work. One useful feature is that it can be overridden by passing an explicit --geometry=X option on the command line.

Last edited by jforberg (2011-05-26 21:33:23)

Re: Setting terminator's initial window size

I sorted this out with a --geometry option in Openbox's rc.xml file. Here's the relevant section:

<keybind key="W-t">
      <action name="Execute">
        <startupnotify>
          <enabled>true</enabled>
          <name>Terminal</name>
        </startupnotify>
        <command>terminator --geometry=485x290</command>
      </action>
</keybind>

Re: Setting terminator's initial window size

Ah, but this only affects terminals the current user launches by pressing super-T, not those launched from the right-click menu or, if he's like me, those terminals launched by writing 'terminator &' inside terminator...

It's still useful of course. If someone knows of a more elegant way to change the starting size system-wide though, that would be interesting.

Re: Setting terminator's initial window size

An alternative to hacking terminator, is to just create a script to launch terminator:

#!/bin/bash
terminator --geometry=485x290

Just give the script a name (say term1), move it into $PATH, and then you can just run term1.

If you prefer keeping the name "terminator", you can rename /usr/bin/terminator, and then make your script "terminator".

Note: ** Please read before posting **

BTW if you wish to contact me, send me an e-mail instead of a PM.

Re: Setting terminator's initial window size

/usr/bin/terminator is a symbolic link. Instead of renaming it, making it a symbolic link to the created script would be better or it doesn't matter?

Re: Setting terminator's initial window size

An alternative to hacking terminator, is to just create a script to launch terminator:

I didn't hack Terminator per se, I just changed Terminator's python launcher script.

Your method would work, and is perhaps better (system updates won't undo the change). Somehow, it feels bad to make a launcher script for a launcher script though...

Last edited by jforberg (2011-06-01 21:59:53)

Re: Setting terminator's initial window size

I got it working by setting the 'size' parameter in terminator's config (Menu > Settings > Terminator Config) as follows:

...
[layouts]
  [[default]]
    [[[child1]]]
      type = Terminal
      parent = window0
    [[[window0]]]
      type = Window
      parent = ""
      size = 700, 500
...

Worked flawlessly (no matter how I start terminator) and didn't even have to restart session.

Re: Setting terminator's initial window size

That's a pixel count, not a character count. Just so everyone knows.

Re: Setting terminator's initial window size

ditto

Last edited by bigbox37 (2012-04-24 10:48:26)

ditto

Re: Setting terminator's initial window size

so here it is !
I was looking exactly for this.
On my eee pc 7" there is no big resolution smile so when terminator is launched it is too small ...
I found a solution with maximized window what is good for small monitors but using external monitor is not really useful if I don't use command line so often.
... thanx again for advices here, I'll try them out.

Statler r20110207 / Asus Eee 702 - 8 GB SSD, 1GB RAM