Installation of Openbox on Debian

Introduction

These are my notes about the installation and configuration of Openbox on Debian GNU/Linux. I’m doing this installation just after the Debian base installation.

Installation

I install X.Org X Window System and Openbox with the following command (as root):

apt-get install xorg openbox obmenu openbox-menu menu # As root.

Then an unprivileged user can start Openbox with:

startx

A right mouse click opens the Openbox root-menu. From there you can launch a terminal.

If the keyboard layout is wrong, try rebooting.

At this point, I install and tweak the applications I want on the system. Then I proceed with the configuration of the Openbox environment and that’s what is described in the rest of this page.

Thunar for file, archive and removable media management

By installing Thunar and its extension for volumes management (thunar-volman), you get a graphical file manager with the ability to mount removable medias. With thunar-archive-plugin you also get the ability to easily open and create archives. Do the installation (as root) with:

apt-get install thunar thunar-archive-plugin thunar-volman # As root.

Follow the link for instructions about how to enable and configure the volume management.

Requiring confirmation before exiting

I want to be prompted for confirmation when exiting Openbox via the root-menu. The same when shuting down the system or rebooting. I could obtain that with entries like the following in ~/.config/openbox/menu.xml:

<item label=”Exit Openbox”>
<action name=”Execute”>
<prompt>Are you sure you want to exit Openbox?</prompt>
<execute>openbox –exit</execute>
</action>
</item>
<item label=”Reboot the system”>
<action name=”Execute”>
<prompt>Are you sure you want to reboot the system?</prompt>
<execute>systemctl reboot</execute>
</action>
</item>
<item label=”Shutdown the system”>
<action name=”Execute”>
<prompt>Are you sure you want to shutdown the system?</prompt>
<execute>systemctl poweroff</execute>
</action>
</item>

Theme and wallpaper

I launch obconf from a terminal window and choose the Syscrash theme:

obconf &

for the wallpaper, I install feh as root:

apt-get install feh # As root.

Then I “install” the wallpaper with commands like:

feh --bg-fill path/to/image.jpg # See https://wiki.archlinux.org/index.php/feh
echo "~/.fehbg &" >> ~/.config/openbox/autostart

Turning NumLock on on Openbox startup

You can install numlockx (as root) with:

apt-get install numlockx # As root.

Adding the command numlockx on & to ~/.config/openbox/autostart ensures that numlockx turns on NumLock on Openbox startup:

echo "numlockx on &" >> ~/.config/openbox/autostart

Binding menu key to root-menu

If your machine has a menu key, you may want to bind it to the Openbox root-menu. Make sure your ~/.config/openbox/rc.xml contains something like:

</keyboard>
<keybind key=”Menu”>
<action name=”ShowMenu”>
<menu>root-menu</menu>
</action>
</keybind>
</keyboard>

Binding Super-E to Thunar

When working on Windows at the office, I usually open the file manager with the Windows-E (a.k.a. Super-E) keyboard shortcut. I want the same on Openbox. I have added something like the following in my ~/.config/openbox/rc.xml:

</keyboard>
<keybind key=”W-e”>
<action name=”Execute”>
<command>thunar</command>
</action>
</keybind>
</keyboard>

Undecorating and/or maximizing windows

I want that Firefox, Claws Mail and xterm open with Window maximized. I also want the xterm window to be undecorated (to get rid of the title bar).

I could achieve that by adding something like the following in my ~/.config/openbox/rc.xml:

</applications>
<application class=”XTerm”>
<decor>no</decor>
<maximized>yes</maximized>
</application>
<application class=”Firefox-esr”>
<maximized>yes</maximized>
</application>
<application class=”Claws-mail”>
<maximized>yes</maximized>
</application>
<application type=”dialog”>
<maximized>no</maximized>
</application>
</applications>

Note the <application type="dialog"> markup for dialog boxes. It prevents the dialog boxes from being maximized.

Benefiting from Vim clipboard feature

Even if using Vim only in a terminal and not as a graphical application, it is useful to install the vim-gtk package instead of just the vim package, to benefit from the clipboard feature:

apt-get install vim-gtk # As root.

Follow the link for an interesting discussion on that topic on vi.stackexchange.com.