Introduction

To understand what Openbox actually is, it's important to know the difference between a window manager and a desktop environment.

A window manager is the program which draws on your screen the "boxes" in which other programs are run. A window manager controls how program windows work, look and act. It decides what window decorations to use and gives you a way to move the windows, hide them, resize them, minimize them and close them. It controls what buttons you push to do those things, and what keys you press to make those things happen.

On the other hand, a desktop environment minds the entire desktop. It provides a taskbar, a system tray, a login manager, additional menus or perhaps screensavers and desktop icons. It might include a file manager, a text editor or some other accessory programs, too.

Openbox is a window manager, not a desktop environment. Openbox is only responsible for maintaining the windows you open on your screen -- nothing else. That means installing Openbox won't give you easy menu access to wallpaper options, a taskbar or system panel, or most of those other doo-dads. It does, however, give you a framework to incorporate other programs that do those things -- and usually with a greater degree of freedom over the style and interface.

Openbox can be used alone, without a desktop environment, or it can be used to replace the window manager in a complete desktop environment. Either way is acceptable.

mention that LXDE uses Openbox by default mention that there's a menu offered by openbox

Installation

The easiest way to install Openbox on a Debian system is using Apt. Therefore, become root and enter the following command at the commandline prompt:

# apt-get install openbox

Normally, a right-click desktop menu will automatically be generated for you on installation.

If, however, your desktop menu is not being auto-generated with DebianMenu, you will have to install the menu package:

# apt-get install menu

Running Openbox

From a graphical login manager

To start an Openbox session from KDM, GDM or LightDM, simply choose Openbox from their respective session-type menu.

XDM, however, doesn't offer the luxury of choosing your favorite session type directly from a menu. As long as you are running Openbox only and without any kind of window manager or desktop environment installed previously, there is no problem with that. XDM will use Openbox automatically. For most other cases, you will need to setup a .xsession file in your home directory and add the following line to it to make Openbox the default session type:

exec openbox-session

Alternatively there is the possibility to use the Debian alternatives (see ?update-alternatives) and setup x-session-manager to be Openbox.

From the commandline

To run Openbox from the commandline, setup the .xinitrc file in your home directory and insert the following line:

exec openbox-session

Then execute startx.

Alternatively there is the possibility to use the Debian alternatives (see ?update-alternatives) and setup x-window-manager to be Openbox.

Note: As with the .xsession file above, you don't have to set up .xinitrc if you are using Openbox stand-alone right from the beginning. Just run startx.

Openbox default key combinations

Control-Alt-Tab Cycle between panel and desktop windows on the desktop

Windows-D Hide all windows to show the desktop

Windows-E Run the Konqueror file manager (This is an example of how to run a program with a key binding)

Alt-Escape Lower the active window behind other windows, and activate the last window that was in use

Windows-F1 Go to the first desktop instantly

Windows-F2 Go to the second desktop instantly

Windows-F3 Go to the third desktop instantly

Windows-F4 Go to the fourth desktop instantly

Control-Alt-Left Open the desktop switching dialog, to go to the desktop to the left of the current one

Control-Alt-RightOpen the desktop switching dialog, to go to the desktop to the right of the current one

Control-Alt-Up Open the desktop switching dialog, to go to the desktop above the current one (This will only be useful if you use a pager to set up a desktop layout with multiple rows)

Control-Alt-Down Open the desktop switching dialog, to go to the desktop below the current one (This will only be useful if you use a pager to set up a desktop layout with multiple rows)

Shift-Alt-Left Open the desktop switching dialog, to go to the desktop to the left of the current one, and bring the active window with you

Shift-Alt-Right Open the desktop switching dialog, to go to the desktop to the right of the current one, and bring the active window with you

Shift-Alt-Up Open the desktop switching dialog, to go to the desktop above the current one, and bring the active window with you (This will only be useful if you use a pager to set up a desktop layout with multiple rows)

Shift-Alt-Down Open the desktop switching dialog, to go to the desktop below the current one, and bring the active window with you (This will only be useful if you use a pager to set up a desktop layout with multiple rows)

Alt-Left mouse button Move a window

Alt-Right mouse button Resize a window. The window is resized towards the edge that the mouse is nearest to. So use Alt-Right mouse button in the top right corner of a window to resize that corner.

Alt-Scroll wheel Change desktops forward and backward

Configuring key bindings

Keybinding configuration is done manually by editing your rc.xml file, normally found in the ~/.config/openbox directory. Full documentation is available at the project's website.

Graphical Tools

Obconf

ObConf is a small graphical utility which configures Openbox's preferences and configuration settings on the fly.

If you are an Openbox user, you probably want this package.

# apt-get install obconf

Obmenu

Obmenu is used to configure Openbox menus. It is a graphical alternative to directly editing one's menu.xml file.

# apt-get install obmenu

Further Arrangements

Wallpapers

As Openbox itself is not capable of managing desktop wallpapers, you will have to use an additional program to set your background image. There are several applications available for that kind of job (see Alternatives section below). The most common is a small lightweight image viewer called feh.

Setting your background image with feh

feh is an imlib2-based image viewer with a number of features, but perhaps the most popular is the ability to draw desktop backgrounds.

In Debian it's provided by the feh package and it can be installed via APT with the following command:

# apt-get install feh

Now, pick a wallpaper and try this command in a terminal:

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

Note: Apart from JPEG, feh can also handle a variety of other image file types, including PNG, TIFF and GIF.

Once you have chosen a wallpaper, feh stores its name in a file called .fehbg. That means you can tell it to restore the wallpaper on the next boot by checking that file. Add the following to the autostart.sh file in /etc/xdg/openbox.

#My wallpaper
eval `cat $HOME/.fehbg` &

Random wallpaper

One neat trick available with feh is a random wallpaper on each boot. Create a directory in your home folder called "wallpapers" and put a few background images into it. Then copy the code below into a file called wallpaper.sh and save it anywhere. A good place is ~/.config/openbox

Desktop icons

Consult the iDesk wiki for instructions on how to configure and use iDesk. For icon sets, you may wish to search the repositories, or download them from third-party customization sites, such as Gnome-Look.org and similar locations.

Rox-Filer

Rox-filer is a file manager, but in addition to handling wallpaper, it also has a pinboard option, and can manage desktop icons. Install rox-filer with this command:

# apt-get install rox-filer

You can set up the pinboard through Rox's menus.

Screen locking

Within a desktop environment, such as KDE, GNOME or LXDE, screen locking is usually handled through the screensaver application and its respective preference dialog. When using Openbox stand-alone, you can either install one of these screensavers, for example xscreensaver (see #Screensavers below), or use only a screen locker. While any of these programs will lock your X session, only some are able to block access to the remaining virtual consoles as well. See Screensaver for more information.

light-locker

When using LightDM, you can use light-locker for locking the screen. It can easily be installed through Apt:

# apt-get install light-locker

light-locker will be activated automatically the next time you log in via LightDM. That means, the screen will be locked whenever it blanks out and you will be redirected to LightDM's greeter, where you will have to enter your username and password to unlock the screen.

Note that light-locker is not responsible for blanking the screen after a set idle time. This is handled by the X Window System itself. The respective parameters can be adjusted via the xset command. To view the current settings run:

$ xset q

Set the desired timeout for blanking in seconds by running:

$ xset s 300

Blanking may be turned off by executing:

$ xset s off

Adjustments made through xset only apply to the current session. To make permanent changes, you either need to manually configure Display Power Management Signaling (DPMS) by editing xorg.conf (see Xorg) or put the xset command into Openbox' autostart script.

light-locker's behavior on blanking can be fine-tuned by applying the --lock-after-screensaver option. As the name suggests, it tells light-locker not to lock the screen before a set period of time has expired after blanking. The desired expiration time has to be given as a numeric value in seconds. Using 0 deactivates automatic locking. The configuration needs to be placed into light-locker's autostart file (/etc/xdg/autostart/light-locker.desktop). For example, if you wanted light-locker to wait three minutes before locking the screen after it has blanked out, your configuration would have to look like this:

[...]
Exec=light-locker --lock-after-screensaver 180
[...]

For further information on how to configure light-locker, see its manual page.

The screen can be locked manually using dm-tool, which is LightDM's command line control tool. You need to run

$ dm-tool lock

from the terminal to lock the screen.

For better convenience, you can assign a shortcut key to this command and as well add it as an option to Openbox' menu. If you're using desktop icons or if your working with a panel that has icons in it, you can, of course, also allocate one of these icons to the locking command.

To assign the shortcut, open Openbox' rc.xml file (either ~/.config/openbox/rc.xml for user-specific or /etc/xdg/openbox/rc.xml for system-wide configuration) in a text editor and find the keyboard section. There should be a subsection containing key bindings for running applications already. Simply add your configuration to it. In Unix desktop environments, it is common to use either Control-Alt-L or Control+Alt+Delete for screen locking. Openbox uses neither of these shortcuts for anything else by default, so either makes a reasonable choice.

To add screen locking to the menu, you need to edit menu.xml (either ~/.config/openbox/menu.xml for user-specific or /etc/xdg/openbox/menu.xml for system-wide configuration). The new item needs to be placed somewhere inside the root menu section:

Note: You might want to back up the original configuration files before editing so that you can restore them if something goes wrong and you're not able to fix it.

Warning: Do not prevent light-locker from being run automatically upon logging in to an X session by editing or renaming its autostart file (/etc/xdg/autostart/light-locker.desktop). This makes things insecure. Solely running dm-tool lock from within an X session is unsafe, even if you manually run light-locker before doing it. In either case, switching to a virtual console and back into X will make the lock screen disappear and give access to your X session.

Taking screenshots

coming soon...

scrot

coming soon...

xwd and convert

coming soon...

Additional software

if using ob stand-alone and not merely as a replacement for the default windowmanager of a desktop environment....some software

File managers

Name

Description

Package information

PCManFM

A fast and lightweight file manager that can draw wallpapers and desktop icons. It is the standard file manager in LXDE.

If you're working on Openbox in conjunction with a Gnome installation, you might also look into gdesklets, which features some very polished monitors and meters for desktop display.

Screensavers

If you're building an Openbox desktop with Gnome already installed, you'll probably already have gnome-screensaver in place. Pure Openbox fans might want to install xscreensaver, which is more customizable and has a wider variety of screensavers involved.

Without Gnome or KDE in place, installing xscreensaver needs a couple of extra commands:

The first command sets up a default directory that xscreensaver will look for when it runs. If you don't create that directory, you'll get a string of error messages the first time you set the preferences.

The second command installs xscreensaver and its optional files.

Now add this command to Openbox' autostart.sh file in /etc/xdg/openbox to start the xscreensaver daemon on boot.

xscreensaver -no-splash &

You can access the xscreensaver preferences panel by running xscreensaver-demo from the Openbox menu or from a terminal window.