Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Is it possible to open a browser window at a given size/location on screen via a shell script ?

I've seen examples of launching Firefox, setting the window size via command line. I've also seen it written up as non working as a Firefox bug. Are there any alternative browsers that will do this that run on 10.04?

share|improve this question
up vote 2 down vote accepted

Yes, this is possible with devilspie (As I am using this myself now). Except, this program runs as daemon and do not require shell script.

It handles application windows' border decoration, behaviour (sticky, always on top), window geometry, position and states (maximize, fullscreen) based on matched traits. It can control not only Firefox, but almost any graphical applications at launch.

To use this, you will have to create the configuration files for each application you want to control. You can find practical examples in this fullest documentation.

If you need GUI to write the configuration files, there's gDevilspie. Newer releases of Ubuntu includes this in Software Center, but you can download directly from its project page.

On second thought, perhaps you are actually looking into "tiling window manager"--which is another different approach.

share|improve this answer

On Ubuntu, I believe Firefox makes use of GTK+, which has options for setting the window metrics. Whether you can do this from another program (e.g. after Firefox loads) is another question, as it has security implications.

This is not really a (simple) answer, but a research direction: you'd have to read the GTK+ documentation, and maybe write up a program using their API in C, Python, or whatever.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.