Learn and Discover Open Source with Daily Genuine Experience. From Coding, Design, Package Management Tweak to Desktop Customization.
 
   

Rules

Goal: Explaining openbox rules in rc.xml configuration

again, have a look at the rc.xml.

Case

I came from Tiling Window Manager, and I always put my startup like this below:

  • Desktop 1: Two terminals (left and right)

  • Desktop 2: Browser (fullscreen)

  • Desktop 3: Text Editor (fullscreen)

  • Desktop 4: File Manager (fullscreen)

No matter what tiling I use. eg. hlwm, dwm, bspwm, i3, awesome I always use this almost similar configuration, for my convenience. So I do not need to change my workflow, everytime I change window manager.

Of course, openbox is a stacking window manager. Hence, I don’t want to treat openbox as Tiling Window Manager. But hey, there is some cool stuff that we can do with rules.

Reading

There is also a whole article for this.

Source

Format

The format is:

  <applications>
    <application name="urxvt*">
      <desktop>1</desktop>
      ...
    </application>
    ...
    </application>

Example

Virtual Desktop Placement

We can choose where, the application shown-up. For eaxmple, we want browser to shown up, maximized on second virtual desktop.

    <application name="firefox*">
      <desktop>2</desktop>
      <maximized>true</maximized>
    </application>
    <application name="chromium*">
      <desktop>2</desktop>
      <maximized>true</maximized>
    </application>

Size and Positioning

Supposed that I want my urxvt to always shown-up, on the center of the first virtual desktop.

    <application name="urxvt*">
      <desktop>1</desktop>
      <size>
        <width>50%</width>
        <height>50%</height>
      </size>
      <position force="yes">
        <x>center</x>
        <y>center</y>
      </position>
    </application>

Splitting Window

Here a trick to make a simpe tiling with rules: left and right, side by side.

    <application name="thunar" type="normal">
      <desktop>3</desktop>
      <size>
        <width>49%</width>
      </size>
      <position force="yes">
        <x>0</x>
        <y>0</y>
      </position>
      <maximized>vertical</maximized>
    </application>
    <application name="geany" type="normal">
      <desktop>3</desktop>
      <size>
        <width>49%</width>
      </size>
      <position force="yes">
        <x>50%</x>
        <y>0</y>
      </position>
      <maximized>vertical</maximized>
    </application>

openbox Config: tiling rules

This above is just an example, I actually always use maximized state for text editor.

We need to set the type="normal" to avoid dialog to be resized.


What’s Next

Consider continue reading [ Menu: Static ].


Epsi Nurwijayadi bio photo
By Epsi Nurwijayadi