LinkedIn Sourceforge Twitter

Vincent's Blog

Pleasure in the job puts perfection in the work (Aristote)

Openbox is amazing. Here I share few tips of my setup

Posted on 2023-05-27 12:24:00 from Vincent in OpenBSD Openbox

I'm a big fan of Openbox and I use it since +10 years now. It's simple to use, has a low foot print. But it has tons of features

In this blog, I'm sharing a simple configuration aspect which facilitate my day to day.

I do not want to convince you between tiling window manager or standard window manager, but you will see that Openbox offers lot of features without touching a mouse.


Introdution

All settings described here under are extracted from the rc.xml file you should have in ~/.config/openbox

I will not describe all default settings, but just focus on what I find the most useful.

Installation

If you have not yet installed Openbox on your OpenBSD machine, the standard pkg_add is enough:

doas pkg_add openbox

Associated to Openbox you have 2 important config files to manage: rc.xml and menu.xml.
they are both located in: ~/.config/openbox

After each modifications of those files, do not forget to reload Openbox. But, there is a key bindings in the standard config for this ;). You should find the following in your rc.xml file.

** - WindowsKey + r**: relaod Openbox config files

<keybind key="W-r">
  <action name="Reconfigure"/>
</keybind>

Keybindings section

Via the following key bindings we car move and size windows without touching the mouse.

** - WindowsKey + left, right, up, down**: Increase window size of 10 pixels in each side separatly:

<keybind key="W-Left">
  <action name="ResizeRelative">
    <left>10</left>
  </action>
</keybind>
<keybind key="W-Right">
  <action name="ResizeRelative">
    <right>10</right>
  </action>
</keybind>
<keybind key="W-Up">
  <action name="ResizeRelative">
    <top>10</top>
  </action>
</keybind>
<keybind key="W-Down">
  <action name="ResizeRelative">
    <bottom>10</bottom>
  </action>
</keybind>

** - WindowsKey + Alt + left, right, up, down**: Decrease window size of 10 pixels in each side separatly:

<keybind key="W-A-Left">
  <action name="ResizeRelative">
    <right>-10</right>
  </action>
</keybind>
<keybind key="W-A-Right">
  <action name="ResizeRelative">
    <left>-10</left>
  </action>
</keybind>
<keybind key="W-A-Up">
  <action name="ResizeRelative">
    <bottom>-10</bottom>
  </action>
</keybind>
<keybind key="W-A-Down">
  <action name="ResizeRelative">
    <top>-10</top>
  </action>
</keybind>

** - Alt + left, right, up, down**: Move window of 10 pixels in respective directions:

</keybind>
  <keybind key="A-Left">
  <action name="MoveRelative">
    <x>-10</x>
  </action>
</keybind>
<keybind key="A-Down">
  <action name="MoveRelative">
    <y>10</y>
  </action>
</keybind>
<keybind key="A-Right">
  <action name="MoveRelative">
    <x>10</x>
  </action>
</keybind>
<keybind key="A-Up">
  <action name="MoveRelative">
    <y>-10</y>
  </action>
</keybind>

** - Ctrl + WindowsKey + v**: resize vertically the active window:

<keybind key="C-W-v">
  <action name="Unmaximize"/>
  <action name="MoveResizeTo">
    <width>49%</width>
    <height>98%</height>
  </action>
</keybind>

**  Ctrl + WindowsKey + h**: resize horizontally the active window:

<keybind key="C-W-h">
  <action name="UnmaximizeFull"/>
  <action name="MoveResizeTo">
    <width>98%</width>
    <height>49%</height>
  </action>
</keybind>

** - Ctrl + WindowsKey + s**: resize the active window to a small size:

<keybind key="C-W-s">
  <action name="UnmaximizeFull"/>
  <action name="MoveResizeTo">
    <width>49%</width>
    <height>49%</height>
  </action>
</keybind>

Applications section

Globally Openbox is perfectly managing window's sizes. By usage it know that a Calculator applicaiton does not need a big window, but a browser or LibreOffice needs bigger ones.

There is one exception which annoys me a bit: Evince.

Indeed, for this application, every time I open a pdf file, the window proposes to present a vie of the 1st page. But in this case the text in too small an not readable.

The following modifications allows me to always open Evince in predefined size which is much better for an easy reading of the PDF.

<application name="evince">
  <size>
    <width>50%</width>
    <height>70%</height>
  </size>
</application>

The following allows me to always place xclock on the top right corner and whitout any borders:

<application name="xclock">
  <decor>no</decor>
  <position force="yes">
    <x>-10</x>
    <y>10</y>
  </position>
</application>

Conclusions

Despite his age, Openbox remains the best window manager to my eyes. It's light, flexible, stable.

When you combine OpenBSD and Openbox you have the most effeicient desktop environment you can dream off ;)



10, 9
displayed: 5137
Comments:

1. From Privacy-Rex on Thu Nov 9 17:17:59 2023

Before I switched to OBSD, I was using a Devuan spin by 'Mr. Green Jeans' called VUUDO. It used OpenBox as a WM also. I liked the distro (No Systemd(estroyer)), OpenBox was very easy to hack (customize.) On OBSD, I've stuck w/ the native FVWM 2.2.5 . So Theo isn't the only one still using it - heh, heh.. I've got it hacked to high heaven, & man is it FAST. Yup, faster than even openbox. But that's just my personal preference. Openbox would be my next choice if I wasn't running Fvwm2.. It has a lot of very nice features

2. From Vincent on Sat Nov 11 21:21:54 2023

Thanks for this comment/feedback/observation




What is the second letter of the word Python?