Openbox : launch a maximize application through ob menu

Solution 1:

Here is a way to open all applications maximized when using the Openbox window manager. (I do not know which distro OP is using and so two slightly different routes are suggested.)

For distros other than Lubuntu:
Make a backup of /etc/xdg/openbox/rc.xml for safety
Open /etc/xdg/openbox/rc.xml with a text editor
Go to the bottom of the file. You should see:
</applications>
</openbox_config>

Just above the line with </applications>, paste the following:
<application class="*">
<maximized>yes</maximized>
</application>
Save rc.xml
Open a terminal and run openbox --reconfigure. This will make Openbox aware of the changes. If not effective, log out and back in. From now on, all applications will open maximized.

(Source)


For Lubuntu 12.10 users, edit ~/.config/openbox/lubuntu-rc.xml instead of /etc/xdg/openbox/rc.xml. (I verified this because I'm using Lubuntu 12.10.)
If you decide you don't want all applications to open maximized, but just some specific ones, you will need the following code instead of the one above for each application that you want maximized:
<application class="......"> (See below)
<maximized>yes</maximized>
</application>
  • Note that the way to find out the application class is via xprop.
  • You will need to have a terminal window open as well as a window of the application whose class you need to find.
  • Type xprop _OB_APP_CLASS in the terminal window and press Enter.
  • Notice the cursor will have changed its appearance to cross-hairs.
  • Now, using the mouse, click in the window of the application you need.
  • Then, look back at the output in the terminal. For example, if I run xprop _OB_APP_CLASS and click on a window belonging to Google Chrome, I see: _OB_APP_CLASS(UTF8_STRING) = "Google-chrome" and "Google-chrome", including the quotes, is exactly what should be typed as the application class.
  • You will need to do this for each application you desire to have open maximized.
    One side-effect of <maximized>yes</maximized> is that not just the primary window but other windows open maximized. For example, in Firefox, pressing Alt > Edit > Preferences or Alt > Help > About will result in maximized panes. The same happens in Chrome's Task Manager (Shift+Esc).

If such behavior is undesirable, xprop will need to be run for both primary and secondary windows to see if they can be distinguished.
For the Chrome, Firefox, Opera and Seamonkey browsers, the following code maximizes only the browser window proper and not "internal" windows:
<application role="browser">
<maximized>yes</maximized>
</application>