Openbox

From Gentoo Wiki
Revision as of 00:31, 5 April 2012 by Radius (Talk | contribs)

Jump to: navigation, search

Openbox is a highly configurable, next generation window manager with extensive standards support. x11-wm/openbox is actively maintained on Gentoo and you can install is as usual using:

root # emerge --ask x11-xm/openbox
Note
This guide is not a replacement to the official Gentoo Openbox Guide at the moment. Its only purpose is to illustrate the changes between version 3.4 and 3.5

Contents

Use flags

→ Information about USE flags
USE flag Default Recommended Description
debug No Use it to build openbox to debug symbols. You need to configure your system appropriately first. See http://www.gentoo.org/proj/en/qa/backtraces.xml
imlib No Support for imlib graphics library
nls No Support for Native Language
session Yes Yes Enable support for session managers
startup-notification Yes Enable support for startup event feedback mechanism
static-libs No Build Openbox static libraries

Configuration

There are four files to consider when configuring openbox.

  • autostart
  • environment
  • menu.xml
  • rc.xml

Openbox installs these files to /etc/xdg/openbox/. If you want to override them, create your own in ~/.config/openbox/.

autostart

The autostart file is the ideal way to execute specific commands and programs when Openbox starts. It makes no difference if you start Openbox using startx or any display manager. Here is an example

File~/.config/openbox/autostart

wallpaper="planet.jpeg"
DESKTOP_ENV="OPENBOX"
conky --daemonize
sleep 1 && nm-applet --sm-disable &
fbpanel &
feh --bg-scale ~/Artwork/${wallpaper}&
batti &
numlockx &

environment

This is the ideal place to export global variables and configure your openbox environment as appropriate

File~/.config/openbox/environment

eval $(gpg-agent --daemon)
eval $(gnome-keyring-daemon)
if which dbus-launch >/dev/null && test -z "$DBUS_SESSION_BUS_ADDRESS"; then
       eval `dbus-launch --sh-syntax --exit-with-session`
fi
LANG="el_GR.UTF8"

menu.xml

rc.xml

rc.xml is used to specify keybindings and mousebindings. It is located in /etc/xdg/openbox or ~/.config/openbox.

The following are the modifiers.

Key Description
S Shift key
C Control key
A Alt key
W Super (windows) key
M Meta key
H Hyper key

To make a keybinding, you can combine modifiers and a key. They are separated with the '-' sign.

Important
Case matters. 'S' (uppercase) is the shift key while 's' (lowercase) is the s alphabet key.

Examples:

Keybinding Modifier
Alt-o A-o
Ctrl-Alt-x C-A-x
Ctrl-Alt-Shift-y C-A-S-y
Shift-s S-s
Important
The keybinding should go between <keyboard> and </keyboard> in rc.xml.

If you want to open xterm with super-t, you should add the following to the rc.xml

File~/.config/openbox/rc.xml

<keybind key="W-t">
  <action name="Execute">
    <command>xterm</command>
  </action>
</keybind>

You can also bind menus. For example, you can bind openbox right click and middle click menu with the following

File~/.config/openbox/rc.xml

<keybind key="W-x">
  <action name="ShowMenu">
    <menu>root-menu</menu>
  </action>
</keybind>

<keybind key="W-z">
  <action name="ShowMenu">
    <menu>client-list-combined-menu</menu>
  </action>
</keybind>

In the above example, the right click menu is bound with Super-x, and the middle click menu is bound with Super-z. It is useful especially if you prefer not to use any panel with openbox.

TODO

Tips

Icons in openbox menu

Since version 3.5.0 you can have icons next to your menu entries. For this:

1) You must emerge openbox with imlib support. Add USE flag "imlib" for x11-wm/openbox into you /etc/portage/package.use like this: "x11-wm/openbox imlib" and run "#emerge x11-wm/openbox"

2) Add <showIcons>yes</showIcons> in the <menu> section of the rc.xml file

3) Add in menu.xml icon="<path>" like this:

<menu label="Shells" icon="/usr/share/icons/shell.png">
	<item label="xterm" icon="/usr/share/icons/xterm.png"><action name="Execute">
		<execute>xterm</execute>
	</action></item>
Personal tools
Namespaces

Variants
Actions
Gentoo Websites logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Navigation
Toolbox
Categories