The Blackbox Window Manager
The Blackbox window manager presents a minimalist desktop containing only a toolbar and a right-click menu.
Reasons you may want to use Blackbox:
- Blackbox doesn't have the internal ability to draw desktop icons, which reduces the amount of screen clutter.
- The simple theme engine, if used correctly can create some surprisingly good-looking desktops without wasting RAM and processor time rendering pixmaps or transparency.
- The total installation footprint (including sample themes) is less than a megabyte.
It doesn't go over the top in minimalism, a basic useful interface is still provided with which to launch applications (from the right-click menu) and manage window properties (from the toolbar or the individual window titlebars).
Reasons you might not want to use Blackbox:
- A lot of almost essential functionality (keybindings is an obvious example) is left out of the basic package, and left to 3rd-party tools like bbkeys.
It's almost impossible to configure some options in .blackboxrc while Blackbox is running, due to it's caching the config in RAM and overwriting on exit.
- The lack of a proper taskbar with which to locate minimised windows (other than the middle-click window list) might make it difficult to find them later.
Installing Blackbox
Blackbox can be obtained either through your package manager, or from http://blackboxwm.sourceforge.net.
A typical blackbox installation consists of the following:
/usr/bin/blackbox, about 400k
Some default themes in /usr/share/blackbox (commonbox if you're using Gentoo), about 300k. These are optional, though - BB will still run without them, you just won't have any default themes.
- Config file in your home directory
I would also recommend looking at bbkeys. Blackbox doesn't include native keybinding support, bbkeys adds this and a small icon in the bottom corner of the screen. This is a useful thing. No, really. I will cover setup of this later.
Configuring Blackbox
Blackbox stores its configuration in a $HOME/.blackboxrc file. Tools such as bbconf exist to fiddle with this, but a text editor will do.
Contrary to most other WM's, the most reliable way to configure Blackbox is outside of it. Blackbox has the strange habit of holding its config in memory, then saving it to disk on exit. Should you have modified said config in-session, well, you get the picture. You can:
Log out, then switch to a console terminal (Ctrl-Alt-F?) and edit $HOME/.blackboxrc in your favourite editor. Then save and log in again.
- There is a menu option that supposedly forces blackbox to reload its config midsession. Try at your own risk.
I have attached here a sample config. You may wish to copy that to your home directory and alter it for your needs. .blackboxrc
.blackboxrc
Each line is of the form "tag: value". Most of the settings in the example can be reasonably left alone. Some can be reliably edited within Blackbox. Important ones to fiddle with, however, are:
session.styleFile - This points to your style. Unless you're using Gentoo or something with a similar /usr/share arrangement, you probably want to use something in /usr/share/blackbox. Set this to a random theme for now, since you can in fact change theme reliably from within Blackbox.
session.menuFile - This points to the settings for our right-click application menu. See .blackboxmenu section for syntax. This file needs to exist.
session.screen0.workspaces - This is the number of virtual desktops
session.screen0.workspaceNames - This is the name of each virtual desktop, which gets displayed on the left side of the toolbar. This list is comma separated, and needs an entry for however many desktops you specified in session.screen0.workspaces.
.blackboxmenu
I have attached a sample file. .blackboxmenu
[begin] (RicksBox) ... [end] starts and finishes the top-level menu. The word RicksBox will be displayed as the menu title. You may wish to change this.
[exec] (Terminal Window) {/home/rick/bin/box/term} adds an application entry labelled "Terminal Window", that runs /home/rick/bin/box/term. The path must be absolute, can include arguments, but doesn't recognise any special bash syntax.
[submenu] (Remote Terminals) ... [end] defines a submenu labelled "Remote Terminals". Submenus can be nested as many levels as you like, and any manner of entries can be placed between [submenu] and [end].
[workspaces] (Workspace List) adds a submenu labelled "Workspace List", which contains an autogenerated list of virtual desktops, which in turn contain an autogenerated list of the windows on them.
[stylesdir] (/usr/share/commonbox/styles) is replaced with an entry for each style definition in /usr/share/commonbox/styles. This isn't automatically collapsed into its own submenu, you need to put it in one yourself.
[include] (/usr/share/commonbox/imagebgmenu) will insert the contents of /usr/share/commonbox/imagebgmenu verbatim. Much like #include in C, or \input in LaTeX. The file must contain some partial menu definition.
[config] (Configure) creates a submenu labelled "Configure" containing an automatically generated tree of configuration options.
[reconfig] (Reload Config) adds an entry labelled "Reload Config" which, when clicked, forces blackbox to, well, reload its config. Note that I've had issues with this, but I could be doing it wrong. So if in doubt, don't.
[restart] (Restart) adds an entry labelled "Restart" that, well, restarts Blackbox. This may or may not restart the X server too.
[exit] (Exit) adds an entry labelled "Exit" that, well, exits Blackbox. This will usually restart the X server.
Using Blackbox
Launching Applications
Right-click anywhere on the desktop to be given the menu you defined in .blackboxmenu. If you don't have a .blackboxmenu, you will get a default one consisting of xterm, Restart and Exit.
Changing Your Theme
From the right-click application menu, providing you have defined a [configure] submenu, there should be a themes menu containing a list of those installed in /usr/share. Clicking on one will immediately change, and whichever one is applied on exit will be saved to .blackboxrc.
Window Management
- If you defined a number of virtual desktops, the current one will be named on the left-hand side of the toolbar. The left and right arrows by the virtual desktop name will switch between virtual desktops
- The title of the currently focused window will be shown in the centre of the toolbar. The left and right arrows to the immediate right of that will switch between active windows on the current virtual desktop.
- Right-clicking the toolbar will present a set of configuration options.
- If you have a 3-button mouse, middle-clicking on the desktop will present a menu of each virtual desktop and the window titles they contain, including iconised windows.
- Middle-clicking on the titlebar of any window will switch between windows on the same virtual desktop.
- Windows in blackbox have a thin border, two resizing handles in the bottom corners and a title bar. The title bar contains a button for Close (X), Maximise (Square), and Iconise (Short Square).
- Double-clicking a window title will toggle shading (reducing the window to just its title bar).
- Iconising a window will remove it from the screen. Iconised windows don't belong to any virtual desktop, and can only be accessed by the Window List menu.
- Right-clicking a title bar will present a context menu of standard window operations. Most useful are "Send To..." (for sending to another virtual desktop) and "Kill Client" (tries to forcibly kill an X application)
Keybinding
Keybindings are acheived using bbkeys (http://bbkeys.sourceforge.net"). This should be started in .xsession (or whatever startup file is used on your system). I use bbkeys -i &, but others include:
-i : Hides the configuration icon completely.
-w : Places the configuration icon in the slit, which looks neater and conforms to your theme.
-s : Avoids drawing the groundplate, a rectangular panel beneath the slit icon.
-t : Reduces the icon to a tiny keyhole.
As you can tell, these are purely aesthetic. Read bbkeys --help for more.
When bbkeys is running, clicking on the keyhole will open an xterm configuration tool. Follow the prompts to set bindings, which fall into the categories of shell commands (ExecCommand) and internal Blackbox stuff. Note that "Mod1" means the "Alt" key. Experiment with some of the bindings, but important ones are:
Close, closes a window.
NextWindow, displays and scrolls through a list in the middle of the screen of each window in this virtual desktop. This behaves like "Alt-Tab" in Windows and some other Linux WM's.
PrevWindow, as above but in reverse direction.
NextWorkspace, scrolls through virtual desktops.
PrevWorkspace, as above in reverse.
Remember to save before quitting the tool.
Hints and Tips
It may be useful to bind ExecCommand keys to common apps, such as web browser and email, rather than using the application menu.
Hence it would be convenient to have such bindings execute scripts rather than the app binary directly. I do this in case I ever choose to use a different program for, say, email. I just change the ~/bin/box/email script and Ctrl-Alt-M still works. Similarly for web browsers, it helps to use a script to detect an existing process and choose whether to launch a new browser or not.
- It's useful to create scripts for specific terminal types. For example, one could bind a key to open a root terminal as opposed to a normal user. Similarly, terminals that launch directly into SSH sessions. Here it's a good idea to look up the manpage of your terminal emulator (xterm/aterm/rxvt/gnometerminal etc.) and find out how to change the default window title from the command line.
Links
Official Site, http://blackboxwm.sourceforge.net
bbkeys, http://bbkeys.sourceforge.net
bbtools, http://bbtools.sourceforge.net
Freshmeat *Box Themes, http://themes.freshmeat.net/browse/920/
Richard Oakham - 05 Mar 2004 CategoryWindowManager