Terminal.app trick?

colddiver

Registered
I saw that the terminal.app can use startup script...

I don't know if it is possible to do this but I would like to make some kind of a script that would open 3 terminal windows each time I launch terminal.app. I would like those windows to have a configuration similar to this:

+---------+ +---------+
I.........I I.........I
I....1....I I....2....I
I.........I I.........I
I.........I +=========+
I.........I I.........I
I.........I I....3....I
I.........I I.........I
+---------+ +---------+

If possible, I would like "top" to start automatically in window 1. With this, I could run X from window 2 and keep 3 for other stuff (killing frozen apps for example).

How do I do that?

Colddiver
 

endian

Dis Member
not sure how to have specific processes start in specific windows, but to ssave the layout, set things up how you want them (position & size) then go to Shell > Save, choose All Windows from the popup, and check Open thsi file when terminal starts up.
 

kegger64

Registered
Set up each window in Terminal as desired. Choose "Save As..." in the File menu and give each window a unique name.

Now go to the Login preferences pane and add each of the saved files to the startup list.

Next time you login... you get what you want!

Keg
 

colddiver

Registered
Thanks... I didn't know that trick. The help files regarding the terminal are rather useless...

Having the layout saved is a good start!

Colddiver
 

kegger64

Registered
Yeah, that will get the windows in the position you want, but it won't open 'top' automatically. There's no method (that I can find) that will start a process when a terminal window is opened. :(
 

colddiver

Registered
That's all right... I tried AppleScript but the terminal does not seem to be scriptable...

Having all the windows in the right spot is good enough... Typing "top" is not that hard anyway! ;)

Colddiver
 

beef

Dinner
anyway... please forget the subject...

I found this in http://www.macosxhints.com

you can save .term files as mentioned above, then you can open the .term files using whatever editor you like. Do a search on "execution" (exec, will do, I guess). Put the path to whatever you want that terminal to run automatically, followed by a "return key" (the document will look unorganized, and that might piss you off, but don't put tab or space).

when you open the terminal, it'll run the specified program at startup.

as far as opening 3 terminals at startup, you can write an applescript to open one of the terminals, then make it run a simple script that opens the other 2 terminals.

I tried to make the applescript open 3 .term files... I have no idea why, it sometimes didn't work... when I changed it to open 1 of the terminals, then make that terminal open the other two .term's, it always works... maybe you 'll get luckier than me and get applescript to open all 3 all the time.

anyway, if you find my instruction to be confusing, you can go to the site mentioned and do a search for "terminal". I forgot what the title of the hint was, but it should be pretty obvious if you look through them. and you might find something useful, too.

Good luck
 

colddiver

Registered
I did what you suggested and added the 3 .term files to my list of things that have to be started automatically on logon and voila!

I have the 3 windows in the right place and running the right processes... I decided not to type enter after the "startx -- -quartz" command since I do not want it to start on logon. If I need it, however, it is only a click and a return away...

Thanks all!

Next challenge (to me at least): get good TrueType font support in X (I have this as a starting point: http://www.linuxdoc.org/HOWTO/mini/FDU/index.html)...
 
Top