views:

765

answers:

3

At my new job I am doing rails development and I am on Ubuntu (my choice). I want to start up emacs, and 2 or 3 terminals, position them, and possibly cd to directories.

I have been looking all over but can't seem to find any application which will do this.

I am asking this here, because if there isn't an app somebody knows about, it will be a programming question, of how can I accomplish this in a KISS way (little ruby script or something).

So: Do you of any applications that will do what I want, or if that fails, do you know of a simple way to programmatically do this myself (I don't care what language/framework).

+6  A: 

A lot of commands accept a -geometry argument (xterm does, for instance, so there's your terminal right there). I'm not sure how Ubuntu handles this stuff, but on Slackware I'd just put the commands I want to run in my ~/.xinitrc file. It's just a script that gets run when X comes up, so you can use it to run your window manager, and any apps you want to come up with X.

ED: Also ISTR many desktop environments like Gnome/KDE/XFCE and even CDE supporting some sort of "save session on logout" thing. You might be able to simply lay out your windows and apps the way you want them, and log out, saving the session, then just don't click that box to save your session in the future.

Adam Jaskiewicz
Adam's answer is what you're looking for. I've written little shell scripts to do this on my redhat system and integrated them into the (shudder) fvwm window manager configuration.
veefu
Hey, I liked FVWM a lot. The configuration was pretty clean and simple to deal with, being plain text. A lot easier than dealing with umpteen dialog boxes and configuration panels, as long as you aren't looking for your window manager to do anything complicated. I'm using DWM now, which is even simpler: it's about 2000 lines of C, and you just edit a .h file to change a few #define statements, and re-compile.
Adam Jaskiewicz
Excellent. This is what I needed, thanks!
Daniel Huckstep
+1  A: 

Write a shell script that launches emacs and gnome-terminal. To start up in a certain directory, there's probably a command line option; for example, in Konsole you can run "konsole --workdir ~" to get to your home directory.

Adam has a good suggestion for positioning. Another method, in KDE again, would be to edit the default settings for emacs and gnome-terminal windows to start at a specific size and position (although that might break down with multiple gnome-terminals, as they'd all be in the same position).

Edit: the option for gnome-terminal is "--working-directory".

Nikhil Chelliah
I want them to start in specific positions too though.
Daniel Huckstep
A: 

I think what you need is devilspie:

http://burtonini.com/blog/computers/devilspie

bitozoid