[openbox] default window size for a specific application

Anthony Thyssen A.Thyssen at griffith.edu.au
Thu Mar 4 19:08:15 EST 2010


On 04 Mar 2010 20:57:33 +0100
Johan Vromans <jvromans at squirrel.nl> wrote:

| "tomislav_maric at gmx.com" <tomislav.maric at gmx.com> writes:
| 
| > The applications seem to ignore the .Xdefaults (firefox and
| > inkscape) and giving them "-geometry" option when calling them from
| > the console does nothing (inkscape= warnings, firefox= plain
| > ignoring).
| 
| Yes. For some unknown reasons modern GTK based apps do not listen to
| these reasonable commands...
| 
| You may wish to take a look at devilspie.
| 
The other way is to watch for the winodw to open then resize it using a
window manager helper program.  I do this myself to reset my firefox
window on startup.

Devilspie is one such program but it watches for new windows FOREVER!
that is every time a new winodw for a a watched application openes it
does the deed, not just for the first one.

I did not what this for my own firefox resize. I only wanted the first
specific window opened a specific size. I also wanted it iconified
automatically which GTK application also do not provide options for.

My solution was to first have an application script called "xwin_find"

Download from 
   http://hobbit.ict.griffith.edu.au/~anthony/software/xwin_find.sh

It is a shell script that for a given period of time waits for a
given window to appear, and return its windowID so I can then
resize/iconify it.

Here is what I do for firefox from by 'extra clients' session script

  ( firefox -P default -geometry 820x1000+530+70 & ) &
  if id=`xwin_find 60 "Anthony .* Mozilla Firefox"`; then
    echo "Main firefox window found (id=$id)"
    # size, position, and iconify
    xwit -resize 820 1000 -move 530 70 -iconify -id $id
  fi

The first line starts it.
the if waits for a window to appear with tne title specified
and notes its WindowID.
Then the 'xwit' program resizes and iconify's it.

you could alos use wmctrl instead of xwit



  Anthony Thyssen ( System Programmer )    <A.Thyssen at griffith.edu.au>
 --------------------------------------------------------------------------
    If we forget to respect our Great Earth Mother,
    She will withhold Her blessings, and no longer provide for us.
                                     -- Jean M. Auel "The Mammoth Hunters"
 --------------------------------------------------------------------------
     Anthony's Castle     http://hobbit.ict.griffith.edu.au/~anthony/


More information about the openbox mailing list