Here's a way to get Google Chrome (and presumably Chromium) to always open with the same size and in the same screen position in a default installation of Lubuntu 12.10:
Part 1:
Back up ~/.config/openbox/lubuntu-rc.xml
.
Open ~/.config/openbox/lubuntu-rc.xml
in a text editor.
Just above the line that contains only </keyboard>
, paste the following (modified as per requirements):
<keybind key="W-C">
<action name="Execute">
<command>/opt/google/chrome/google-chrome --window-size=675,725 %U</command>
</action>
</keybind>
Part 2:
Just above the line that contains only </applications>
(near the end of the file), paste the following (modified as per requirements):
<application name="google-chrome">
<position force="yes">
<x>-0</x>
<y>0</y>
</position>
</application>
Save the file and exit the text editor.
Open a terminal and run openbox --reconfigure
to register the changes made to lubuntu-rc.xml
.
Launch Google Chrome by pressing Super+C.
Notes:
- the
window-size=w,h
switch and other switches can be found here: List of Chromium Command Line Switches.
- C, S, A, W stand for Control, Shift, Alt, and Super (or Windows) keys, respectively.
- The combination of
<x>-0</x>
and <y>0</y>
forces the upper right corner of the Google Chrome window to be positioned in the upper right corner of the screen.
- A combination of
<x>0</x>
and <y>0</y>
would force the left upper corner of the Google Chrome window to be positioned in the upper left corner of the screen.
- The comments in the Applications section of
lubuntu-rc.xml
have further details on window placement.
chromium-browser --geometry=140x40+0+0
in lubuntu-rc.xml. If you wish, you may edit your question to include this information. Also, just in case you aren't aware, you need to refresh "openbox" after you edit lubuntu-rc.xml by runningopenbox --reconfigure
in a terminal. If you just get back your prompt, it means your file is in good shape.