3

I'd like my Chromium window to open with the same size and in the same place every time. I thought I'd be able to make this happen by editing lubuntu-rc.xml like this:

chromium-browser --geometry=140x40+0+0

But it doesn't seem to make any difference.

Chromium does remember the last size, but never the last location.

  • 1
    Does chromium always open in unoccupied space? – Jack Feb 10 '13 at 19:21
  • OP may be wanting to open the browser every time in a specific position with a specific size, whether or not other applications are open? I guess what you're pointing out is that the window manager tries to display windows so that they don't overlap (or overlap minimally); is that right? – user25656 Feb 11 '13 at 3:55
  • Please explain where you place this 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 running openbox --reconfigure in a terminal. If you just get back your prompt, it means your file is in good shape. – user25656 Feb 11 '13 at 4:04
1

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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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