From ArchWiki
Revision as of 16:44, 29 September 2007 by GODhack (talk | contribs) (Mouse cursor themes: dl url)
Jump to: navigation, search

Template:I18n links start Template:I18n entry Template:I18n entry Template:I18n links end


First install Openbox package, either:

pacman -S openbox

or you use a PKGBUILD from ABS.

Once openbox is installed you will get a message to move menu.xml & rc.xml to ~/.config/openbox/ in your home directory:

mkdir -p ~/.config/openbox/
cp /etc/xdg/openbox/rc.xml ~/.config/openbox/
cp /etc/xdg/openbox/menu.xml ~/.config/openbox/

Note: make sure you do this as your regular user, not as root.

In the file "rc.xml" you can change various settings for Openbox (or you can use ObConf). In "menu.xml" you can change your right-click-menu.

To be able to log into openbox you can either go via graphical log in KDM/GDM or startx in which case you will need to edit your ~/.xinitrc (as user) to the following :

exec openbox-session

For KDM/GDM there is nothing left to do, Openbox is listed in the sessions menu in KDM, as well as options for running Openbox within KDE or GNOME (if you have them installed).


ObConf is a very useful tool that you will need. So first get it with pacman.

pacman -S obconf

Now you can log into Openbox. Right click the mouse on your desktop background to access the main menu.

Use menumaker to create your first menu

menumaker is a very useful tool to create the xml-based menus for a various of WMs, and of course it works fine for OpenBox

First you have to get menumaker with pacman

pacman -S menumaker

as a normal user you can now run

mmaker -v OpenBox3

This will search your system for whatever applications you got, and adjust your ~/.config/openbox/menu.xml accordingly.

You can also use a utility like ObConf (available in the extra repository) or ObTuner (available in the AUR) to more easily edit your Openbox preferences.

Openbox themes

Themes for Openbox should be extracted to ~/.themes and can be installed or selected with ObConf.

A good resource for themes is

Running programs at startup

Openbox 3.4 has support for running programs at startup. This functionality is provided through the "openbox-session" command.

There are 2 ways to enable autostart:

  • If you use startx to log into your X session, change the line that runs "openbox" to run "openbox-session" instead. This enables autostart.
  • If you log in with GDM/KDM, then select the default "Openbox" session and it will automatically use autostart.

Note: If you made your own custom log in options for older Openbox versions, you can delete them to reduce confusion when you are logging in. Openbox installs its own now.

To add programs to your Openbox autostart, you add them to ~/.config/openbox/ Full instructions and best practices for how to do this are available here.

Additional programs

Background image

Openbox itself does not include a way to change the background image. This can be done with programs like Feh:

pacman -S feh

Feh is a lightweight image viewer that can be used to draw the desktop background with the command

feh --bg-scale /path/to/image.jpg

For the program to restore the last assigned image when Openbox starts, add this to your startup file (/.xinitrc):

eval `cat ~/.fehbg` &

Other programs you can use to do this are ImageMagick, hsetroot and xsetbg.

File managers

There are many possibilities, but the best lightweight file managers are ROX and Thunar. Also PCMan File Manager (pcmanfm) looks promising. For even more lightweight options, consider Gentoo or emelFM, both of which use the familiar 'Midnight Commander' two pane layout (these two require gtk 1.2.x).

Fonts in gtk apps

If you want to change the type and size of your fonts, add this to ~/.gtkrc-2.0 or ~/.gtkrc.mine if u don't want to mess your ~.gtkrc-2.0

style "user-font"
font_name = "[font-name] [size]"
widget_class "*" style "user-font"
gtk-font-name = "[font-name] [size]"

where "[font-name] [size]" is e.g "DejaVu Sans 10". You need to fill in both fields because of backwards compatibility.

Gtk/icon themes

No one likes the default gtk2 theme and you don't need to run gnome-settings-daemon to change it.

pacman -S gtk-theme-switch2

Run 'switch2' to change your gtk2 theme. If you want to change gtk1 theme, install 'gtk-theme-switch', and run 'switch'.

Changing icons is a little harder, you should only really do this if you use the nautilus file manager.

Download some icons, I recommend the Tango icons. Extract the icons in /usr/share/icons/ or ~/.icons.

Add this to ~/.gtkrc.mine:

gtk-icon-theme-name = "[name-of-icon-theme]"

Note: The icon theme name is the name of the folder in /usr/share/icons/ so if the folder was named archlinux-icons you would put archlinux-icons as the [name-of-icon-theme].

Icons on desktop

If you want icons on your desktop, you can use ROX or iDesk. ROX have one great advantage - it is also lightweight file manager.

Mouse cursor themes

To change this, download a theme ( and put the folder in /usr/share/icons or ~/.icons.

Add this to ~/.Xdefaults:

Xcursor*theme:   [name-of-cursor-theme]


There are quite a lot of panels you can install to provide a taskbar and pager to Openbox. The most common are:

Make your choice and add it to your startup file.

Run Program dialog

If you want a Run Program dialog that pops up when pressing Alt+F2, like in Gnome and KDE, you can use "gmrun"

pacman -S gmrun

Add the following entry to the <keyboard> section ~/.config/openbox/rc.xml

<keybind key="A-F2">
<action name="execute"><execute>gmrun</execute></action>

Using OpenBox with GNOME

  1. Install GNOME.
  2. If you use GDM, select the "GNOME/Openbox" login option.
  3. If you use startx, setup ~/.xinitrc to run GNOME/Openbox: exec openbox-gnome-session

Using OpenBox with KDE

  1. Install KDE.
  2. If you use KDM, select the "KDE/Openbox" login option.
  3. If you use startx, setup ~/.xinitrc to run KDE/Openbox: exec openbox-kde-session

Per-application settings

Openbox has per-application settings since openbox 3.3 These settings can be set in ~/.config/openbox/rc.xml by creating new XML element inside <openbox_config> called <applications>, which will contain the settings. Inside <applications> you will need <application name=""> which will determine which application this setting is going to affect. The ways to determine the application are name, class and role, eg.

<application class="Firefox-bin">

The class and name can be found by running

xprop | grep WM_CLASS

When you click the application you want to configure, it will return something like

WM_CLASS(STRING) = "Gecko", "Thunderbird-bin"

The first one is what you put inside name="" and the latter one is for class="", you can use either one, but I prefer the one which doesn't get mixed with anything. After this you need to set the settings you want, available settings are

decor - whether window has borders, titlebar and so on, values yes or no, on or off 
shade - whether the window is shaded to the titlebar or not (doesn't work with decorations off), values yes, no, on, off and so on
position - position of the window when started needs subsection
 <x>pos</x>     - position on pixels reading from top left corner
 <y>pos</y>     - center as value and such work too, you can also leave x or y out if you only want to adjust one value.
focus - whether the window gets focused when starting it (not sure about this), values yes no and so on
desktop - desktop (workspace) the application starts, value desktop number reading from 0 (if its opened to another desktop, it doesn't get focused)
monitor - xinerama head the application starts (useful when you have 2 monitors and want the application to open in another, eg nvidia twinview uses xinerama), values 0 1 screennumber and such
layer - layer the application starts on, values Bottom, Normal and Top
iconic - whether the application is to be launched iconic, values yes, no, on, off and so on
skip_pager - application skips pager, values yes, no, on, off and so on
skip_taskbar - same as above, just taskbar, values yes, no, on, off and so on
fullscreen - whether app should be started fullscreen, values yes, no, on, off and so on
maximized - type of maximization, values Horizontal, Vertical, yes, no, on, off and so on.

Example config showing firefox opening 30 pixels from top centered with horizontal maximization

  <application class="Firefox-bin">

External Resources