Do you often end up with a cluttered desktop where you have several instances of the same application running? You need quick access to a particular application (often a file manager or terminal in my case) and instead of looking for the current open instance you launch a new one. After a few hours, you notice you have 4 terminals running and three Thunar windows, where one instance of each would suffice. If you often end up in a similar situation, despair no more!

Vaughn Dickson posted a very handy script on the Openbox mailing list and his wiki that either launches an application or gives it focus if it is already running.

I have modified the script a little and created a second one for Thunar. In my version, it moves the open instance of Thunar or the terminal to the current desktop (rather than moving me to the desktop where that window currently is running). You can find my Thunar script here, and my Terminal script here. If you would like to open a new Terminal/Thunar window if there is none on the current desktop, instead of moving the existing window to the current desktop, replace the last line of the script with $terminal_exec & or $thunar_exec &. Note that you need to have wmctrl installed to use this script (it should be in the repositories of most distributions).

Make the script executable (chmod +x path to the script) and assign a keybinding to it. I bound these two scripts to the keys I normally use to launch the xfce4-terminal and Thunar (Mod4+F3 and Mod4+F4). It speeds everything up enormously, since I no longer have to wait for the application to launch (or go looking for it among my open windows).

Thank you very much, Vaughn! This is a great tool :D

Judging from the search engine terms that show up in my WordPress dashboard, a lot of the visitors to this blog are searching for a comparison between either Fluxbox and Openbox, Openbox and Pekwm, or Pekwm and Openbox (search terms such as Pekwm vs. Openbox, or Openbox vs. Fluxbox are rather common).

To satisfy the desires of my dear readers, and to help those who want to know more about some window managers, I have therefore created the following table comparing four very popular window managers (or three very popular ones and one that I happen to like a lot :-)): Icewm, Fluxbox, Openbox and Pekwm.

Icewm, Fluxbox and Openbox have a wide user basis, and a very loyal following. Pekwm is a lesser known window manager that deserves more attention. I mainly use Openbox and Pekwm, and occasionally Icewm.

Please note that this table is not an indication of the most versatile, most developed or ‘best’ window manager. If a window manager lacks a feature, it may have some different strengths. Openbox, for example, does not support pixmap themes, but its theme options are the most complex and elaborate theme options of these four window managers (which makes creating themes for Openbox so much more fun!). Some features may also be primitively implemented: Pekwm supports dockapps, for instance, but its harbour is not very well developed. Nor does this chart provide an exhaustive list of features for these window manager. Icewm, for example, has a number of unique features that are not mentioned in this table (such as an email indicator and some system monitoring tools for the taskbar), and a lot of the basic features of window managers are left out.

I created the table so you could easily find out what each window manager can or cannot do. Choose whichever window manager you like best. Using one over the other doesn’t make you superior. :-)

There is a reasonable possibility that this table contains some errors. If you find any, please let me know. If I can think of more categories, I’ll add those later.

Icewm Fluxbox Openbox Pekwm
First release 1997 2001? 2002 200?
Last stable release 1.2.34
(27-12-2007)
1.0.0
(08-10-2007)
3.4.7
(17-04-2008 )
0.1.6
(28-05-2007)
Language C++ C++ C C++
Based on Blackbox originally Blackbox originally aewm++
EWMH standards partial partial yes partial
Panel yes yes no no
Support for dockapps no yes (slit) yes (dock) yes (harbour)
Native wallpaper support yes yes no no
Alt-tab dialog yes (vertically and horizontally!) no yes yes
Command dialog yes (in taskbar) yes (fbrun) no yes
Xinerama support yes yes yes yes
Native (fake) transparency no yes no no
Pixmap themes yes yes no yes
Multiple workspaces yes yes yes yes
Viewports no no no yes
Add/remove workspaces no no yes no
Usable screen edges no no no (in git version) yes
Strut support no no yes no
Right-click desktop menu yes yes yes yes
Configurable client menus no no no yes
Keyboard shortcuts in menus yes yes yes no
Dynamic menus no yes yes (pipe-menus) yes
Additional custom menus no yes yes yes
Icons in menus yes yes only in client-list-menus no (only in client-list-menu of git version)
Grouping/Tabbing of windows no yes no yes
Opaque moving/resizing yes yes only resizing yes
Minimize window to tray yes no no no
Hide windows yes no no no
Tiling yes (vertically and horizontally) no no (GrowTo… actions) no (‘MaxFill’ actions)
Per-app settings yes only grouping yes yes
Configurable key bindings yes yes yes yes
Chainable keygrabber no yes yes yes
Configurable mouse behaviour Some in the preferences file yes (in keys file) yes yes
Session management/
Autostarting applications
yes yes yes yes
Confirm logout yes no yes (3.4.7) no
Shutdown/reboot control no no yes (3.4.7) no
Graphical configuration tools plenty Fluxconf, Fluxmenu Obconf, Obmenu no

Orange and Black

April 20, 2008

To my surprise I have been using the same desktop setup (wallpaper, themes, icons, fonts, panels, etc.) for nearly two months now. Though I have occasionally gone for very different colours or a different window manager, I generally returned quickly to Pekwm and the following setup:

This environment turned out to be nearly perfect for my needs. It is aesthetically pleasing but not distracting. There are no icons at the bottom (or top) of the screen attracting my attention, and all the colours go well together, even with OpenOffice, the application I rely on most for my work.

The wallpaper is Golden, by Miemo. The Pekwm theme is a slight modification of Mire v2-orange by Lyrae/Thrynk. The Gtk theme is my own creation, though it is heavily based on MurrinaSunshine. The fonts are Arial Rounded MT 9.

The icons are my own modification of the Area O (areo) icon set, originally created by the great Heylove. They were ported, (without heylove’s consent, I believe) to Gtk, but are no longer visible on gnome-look.org. I think they are still included in some theme archive over there, but can’t remember which.

I changed the colour of the theme to match my Gtk and Pekwm theme, and made a few other modifications. The original icons set used a single icon for all file types — very impractical! — so I’ve added icons for each mimetype, indicating what file extension they have. Since the icon set is also incomplete, I’ve added a few icons to have a more uniform style. I don’t own the rights to these icons, and have only modified them for personal use, so unfortunately I can’t pass them on (I am one of those strange people that take copyrights seriously :-))

The panel at the bottom of the screen is pypanel with netwmpager on the right. The applications running in the second screenshot are (clockwise, starting from the upper left corner): the wonderful file manager Thunar, Orage, Gmpc (my favourite mpd client, which is surprisingly light), and Xfce4-terminal. At the top of the screen you can see dmenu in action.

There are a few minor disadvantages to this setup. (1) I don’t have a system tray. I don’t want to use pypanel’s tray, as the icons don’t go well with the rest of the style. If I really want/need a system tray I generally load docker in the harbour, though I have learned to work without a system tray most of the time. (If there were a text-based system tray (ttm-style), I might try to integrate it into my desktop, but I don’t believe something like that exists). (2) I still haven’t figured out how to launch OpenOffice with the Gtk widgets in Pekwm (apart from ooffice –widgets-set gtk), so I still have to launch it from the terminal. “export OOO_FORCE_DESKTOP=gnome” works in .bashrc, but not in Pekwm’s start file.

I’ve heard the Ubuntu developers want to create an orange and black Gtk theme for the next Ubuntu release (8.10). If it looks like this, I won’t complain.

I’ve recently found a very comprehensive and informative overview of window managers for Linux: ‘The Window Manager Report’.

I’m sometimes amused by the number of persons that still direct new users of Linux for more information about window managers to Xwinman.org (where Window Maker still heads the charts as most popular window manager and Openbox or Pekwm aren’t even choices in the poll). I used to think that was the only overview of window managers available (other than Wikipedia), and was therefore very pleasantly surprised to find this excellent site.

Giles Orr, the creator of the website, gives a comprehensive table of window managers, giving a brief description, linking to its homepage, Wikipedia, and Freshmeat page (where applicable), and mentioning when the wm was last updated. You can sort the table according to your preferences (name, version number, release date, etc.).

He also provides a Bloodlines chart, showing who borrowed ideas and/or code from whom.

If that wasn’t enough, he also created a table of the memory usage of window managers, indicating how light or heavy a window manager runs as well as on how many libraries it depends. If you only want a window manager written in a particular language (C++, Python, etc.), you’ll be happy to know that he also has a page for that.

The site is regularly updated. The last update for the window manager overview was done yesterday (April 7 2008). Giles Orr started with reviews of window managers last year, but hasn’t added any lately.

This site has helped me discover some unknown window managers, as well as a few neat ‘helper applications‘ (even, or especially, if that page mentions some archaic apps). Many thanks Giles! :-)

Thanks to the infinite knowledge of Mikachu, I’ve finally figured out how to switch window managers while running Openbox without having to terminate any running applications. Using the Openbox ‘restart’ action, you can launch a different window manager. To do so, add the following to your menu.xml file (using Pekwm as an example):

	<item label="Pekwm"> 
	<action name="Restart"><command>Pekwm</></> 
	</item>

You won’t be able to do this through Obmenu, but text files aren’t that scary. ;-)

For all you Pekwm enthusiasts: you can do the same thing easily in Pekwm using the RestartOther action ({ Actions = “RestartOther openbox” } for example). I’m not sure how that works in other window managers; you might not be able to switch back to Openbox without logging out.

PCMan, one of the developers behind the LXDE project, has just released a first version of LXappearance, a simple application to change the Gtk theme, icons and fonts when outside Gnome or Xfce.

The application is very straightforward. There is a tab to change the Gtk theme, one for the Icons and one for ‘Other’, which at the moment only allows you to change the toolbar style of Gtk applications (icons, icons and text, only text, etc.). It has a preview window which updates automatically when you select a different theme, but changes are only applied when you press the ‘apply’ button.

Here are a few screenshots of the application in action:

As far as I can tell, this is now the best theme-changing application available for window managers. Unlike its predecessors, gtk-theme-switch and gtk-chtheme, LXappearance can set the icon theme for you as well, and the instant preview of the theme is well implemented. You can also install new themes with it, though I admit I haven’t tested that yet. The only issue I’ve had so far, is that the icons and Gtk themes are not listed alphabetically in LXappearance (as you can see in the screenshot). I’m not sure what the logic is behind the listing, but it isn’t very handy.

Note that LXappearance overrides your ~/.gtkrc-2.0 file, where it stores the Gtk theme, icon, font and toolbar settings, so be sure to back that file up if you have some settings in there you’d like to keep. I also had to uncomment the icon settings I had specified in my ~/.gtkrc-2.0.mine file; for some reason they overrode the settings in ~/.gtkrc-2.0.

This is a great addition for those who use window managers without desktop environments, but want a light and attractive way to change their Gtk settings. I’ll be updating the Openbox guide soon.

During my recent stint with Firebox, and before that while I was trying out wmii, I’ve grown very quickly accustomed to dmenu. After only using it for a few hours, I fell in love with it: it is so convenient to launch an application when you don’t have your hands on the mouse; launch dmenu, just type a few letters from the application name, make sure you have the right app selected, press enter and your app shows up.

Unfortunately, Firebox is still too unstable to use as a primary window manager, and I haven’t grown accustomed to tiling window managers (yet?). So I began to wonder whether it is possible to run dmenu or something similar in Openbox and Pekwm, and – guess what? – it is very easy! (Why did I ever think otherwise?)

First, you’ll need to install dmenu. You can download the source code from the dwm/wmii website and install that (‘sudo make clean install’ in Ubuntu). To launch dmenu in Openbox and Pekwm, I use the following command:

	$(dmenu_path | dmenu -b -nb '#E0E9D0' -sb '#a6b38d' -sf '#070806')

This launches dmenu at the bottom of the screen (-b), with a colour scheme to match the Aeterna Openbox and Gtk theme. You can change the settings (everything that comes after ‘dmenu’ in the above command) to suit your preferences; read the man pages (‘man dmenu’) to see what options you have.

I have this bound to Alt+F3 in both Pekwm and Openbox (Alt+F1 launches the root menu and Alt+F2 launches gmrun). In Pekwm, I added the following to keys file:

	KeyPress = "Mod1 F3" { Actions = "Exec  $(dmenu_path | dmenu -b -nb '#E0E9D0' -sb '#a6b38d' -sf '#070806') &" }

To get dmenu to work in Openbox was a little more complex. If I added the above command to the rc.xml file dmenu wouldn’t launch (Openbox-Message: Failed to execute ‘$(dmenu_path | dmenu’)': Failed to execute child process “$(dmenu_path” (No such file or directory) say the xsessions-errors.). I’ve tried adjusting the command in several ways, but couldn’t find one that did work, so I ended up creating a script to launch dmenu in Openbox. It is very straightforward:

	#!/bin/sh
	exec $(dmenu_path | dmenu -b -nb '#E0E9D0' -sb '#a6b38d' -sf '#070806')

I saved the file as OBdmenu in ~/.scripts, where I keep all my scripts, made it executable (chmod +x ~/.scripts/OBdmenu), and added the following to the rc.xml file

For Openbox, this is what I added in the <keyboard> section of the rc.xml file:

    <keybind key="A-F3">
      <action name="Execute">
        <execute>/home/urukrama/.scripts/OBdmenu</execute>
      </action>
    </keybind>

Here is a screenshot of dmenu running at the bottom of the screen in Openbox:

OBdmenu

The only downside to using dmenu in this way is that the applications launched by it don’t show up with their application name in your favourite system monitor, but as the command you used to launch dmenu (OBdmenu in my Openbox session, $(dmenu_path etc. in my Pekwm session). I have no idea how to get around this, but it is only a detail. Otherwise, dmenu is fantastic. It won’t replace my right-click root menu, but it is a great addition to any window manager.

Update: As Tami points out in a comment below, you can get around this problem if you use the following command to launch dmenu:

	`dmenu_path | dmenu -b -nb '#E0E9D0' -sb '#a6b38d' -sf '#070806'` && eval “exec $exe”

In Pekwm, you can use this command in the Keys file, but in Openbox you’ll still have to use a script to launch dmenu (as explained above).

This should also work in other window managers, such as Fluxbox, or desktop environments like Xfce, though I haven’t tried it.

Firebox

February 5, 2008

In my search for fun window managers to fool around with, I recently came across Firebox, a light and actively developed window manager, “something between Openbox and wmii: small, quite fast, eye candy and keyboard oriented, with some or[i]ginal features” (according to the website).

I haven’t been able to test the latest version yet (0.5), as I couldn’t meet its dependencies on my experimentation machine running Ubuntu Dapper (please don’t ask me why I use a semi-outdated OS on an experimentation machine :-)), so for now I’ve only been playing with the previous release (0.4), which is about half a year old. So far, I’m liking it a lot. Sometime soon I’ll install 0.5 on a more recent OS, as, according to the changelog, it seems to have improved substantially in features (tabbed browsing, compositing support) and performance.

So what is Firebox like? Here is a screenshot, using the default Firebox theme:

Firebox

As you can see it resembles Openbox: it has a root menu, but no taskbar, and its alt-tab and desktop switching dialog looks very much like those from Openbox 3.3. Firebox also has a nice configuration application, fbconf, which resembles Obconf. Like Openbox, the Firebox configuration is done in xml files. The website states that Firebox “is not forked from Openbox, Fluxbox, Blackbox or even Hackedbox; it is written from scratch, in C lang[u]age”, but it is clear where the developer(s) took some inspiration from.

Here is a picture of Fbconf, the configuration application of Firebox:

Fbconf

One of the neatest things about Firebox is its dmenu. Users of wmii are familiar with this: press Alt+P and a menu bar comes up containing all the installed applications; type the first letters of the application you want to launch, and it shows all the applications that start with those letters. By default the dmenu bar appears in the middle of your screen, but you can also set it to display at the top or bottom.

Firebox dmenu

You can add entries to the dmenu, both to launch applications and to perform internal Firebox actions, though I have to admit I didn’t quite understand yet how exactly this works. Unlike in wmii, Firebox’ dmenu can display icons, though by default it doesn’t do so.

As far as I could tell, the root menu can unfortunately not be configured, which makes it rather unusable, and the developer is even considering dropping it all together. The combination of the dmenu and the root menu is great, though, and I hope both continue to be developed. Firebox has some nice touches, like the window geometry which is shown in the title bar (instead of the usual pop-up) when you resize or move windows.

The documentation for Firebox is fairly decent. If its comments on the configuration seem rather brief (“Please use the preferences editor.”), that is because all the configuration can be set in the preferences editor (fbconf). The theming documentation is very elaborate, which is always a good thing. :-)

There are six themes available, but those don’t seem to work with 0.4 (they either crashed Firebox or didn’t load at all). The themes that are available are not quite along my aesthetic lines, but that is alright. The theme engine supports some pixamps. The theme options are a little confusing at first, but there are plenty of options to work with.

Firebox runs slightly lighter than Pekwm or Openbox, but the version I used, runs very slow at times, especially when you exit the dmenu or root menu. Since Firebox is still in relatively early stages of development, it is still rather limited in what it can do, and a lot of configuration options I’d like to see are still absent. Firebox 0.5 seems to have improved considerably over 0.4, the version I talk about here, and hopefully it continues to mature that way. The next release will be focused “on making the manager more keyboard oriented: tiled windows, improved keybindings and constraints.”

The occasional bugginess of the dmenu, its crashes, and the unconfigurable root menu make this release of Firebox not very suitable to work with, but I’ve developed a certain fondness for it. Sure, it crashes at times, and has a few occasional glitches, but this project has potential. If it becomes more stable and increases its functionality (keyboard bindings, more window management options, tiling windows, perhaps even a dock/slit) this will be a solid window manager. At the moment it appears to be largely a one man project (the only developer is Cyrille Bagard), but hopefully others will join and help out. Though I won’t be using Firebox as a working environment anytime soon, I’ll use it as a play ground and will keep an eye on its development. Perhaps I’ll even create a theme or two for it, just to support it in a way that I can.

One of the great features of Pekwm is the ability to use the screen edges. Just like the desktop, you can click on the screen edges to perform certain actions. In the default settings, right clicking on the screen edges brings up your root menu, middle click on it and you see your client menu, left click on it and you will switch to the next workspace in that direction.

The beauty of the screen edges is that, unlike the desktop, they remain available when you have maximize windows or windows in full-screen mode. This means you can still use the mouse to call up the root menu (without setting a margin, as you would in Openbox), or perform other actions. I really hope this is implemented in one of the future releases of Openbox (and hope any of the Openbox devs is reading this! :-)).

Earlier I have written about how you can use the screen edges to semi-autohide the harbour, but their potential is much greater. I will describe two examples here, and hint at a few more uses .

Tilda

Tilda is drop down terminal. Though I rarely use it myself, it is a handy app if use the terminal regularly, but don’t want to switch to the open terminal whenever you need it: Just press a key (F1 by default) and your terminal window drops down from the top of the screen.

Tilda only appears with a keypress, though, so you’ll have to translate or simulate the keypress with a command. After much searching and asking, I finally found several ways of doing this. The easiest is by using xautomation. First install the application:

	sudo aptitude install xautomation

Xautomation allows you to control X from the command line, and consists of several applications. The one you will need here is xte, which generates fake mouse or key inputs. To have F1 pressed and released, you would use the following straightforward command:

	xte "key F1"

(A more complex way of doing this is by using xmacro as explained here)

Now you will have to bind this to a mouse action on a screen edge. Since Tilda is a drop down terminal, I prefer the upper edge (‘Up’) and add the following line to my mouse file (in ~/.pekwm) in the ScreenEdge Up section:

	ButtonRelease = "1" { Actions = "Exec xte 'key F1'" }

Reload Pekwm and whenever you left click on the top screen edge, Tilda will appear (provided Tilda is running obviously). If you would like Tilda to appear whenever the mouse moves over the top screen, use the following line:

	Enter = "Any Any" { Actions = "Exec xte 'key F2'" }

Skippy

The real reason I started playing with Pekwm’s screen edges was to play with one of my much-loved applications: skippy, a full screen task switcher

I wanted to see if I could create a Mac exposé-type effect: if I move my mouse in a particular corner of the desktop, skippy automatically launches and I get a miniature version of all open applications on my screen.

Using Pekwm’s screen edges and xte, this is fairly easy to achieve, were it not that skippy doesn’t actually work like it is supposed to in Pekwm. Skippy launches fine, but remains under the open applications. I’ve tried several things, and the only workaround I have now is to raise the skippy window with wmctrl, but even that is problematic.

If you haven’t done so already, install wmctrl first (sudo aptitude install wmctrl). You now need to get the id for the skippy window. To do this, launch skippy as usual and keep the window miniature windows open. In a terminal type “wmctrl -l” and you will get an overview of all running windows, like this:

	0x02a00001 -1    N/A N/A 
	0x01e00004  0 yantra Blank page 
	0x01a00003  0 yantra urukrama - File Manager 
	0x0240001e  0 yantra Terminal 
	0x01800002  0 yantra [pekwm-users] Skippy and Pekwm 0.1.6 - Opera 
	0x01600003  1 yantra System Monitor 
	0x00c00003 -1 yantra panel 
	0x01000001 -1    N/A netwmpager

The first column contains the window identity as a hexadecimal integer, the second the desktop number (-1 is a sticky window), the third contains the name of your computer, and the final column shows the window title. In the above list, Skippy is the first entry (where the title is given as N/A). You will need the window id of this (in this case 0x02a00001) to raise skippy automatically to the top whenever it is launched. Then open your ~/.pekwm/mouse file and add the following lines to the ScreenEdge section (choose whichever screen edge you prefer; I add it to the right one):

	ButtonPress = "2" { Actions = "Exec xte 'key Scroll_Lock'" } 
	ButtonRelease = "2" { Actions = "Exec sleep 1 && wmctrl -i -r 0x02a00001 -b add,above" }

I have configured skippy to launch when I press Scroll_Lock, so these settings will launch skippy whenever I middle click on the (right) screen edge. Replace Scroll_Lock with whatever key you have bound to skippy. The second line is used to make wmctrl raise the skippy window to the top a second after it is launched.

There are several important disadvantages of this workaround. First of all, skippy’s id changes with every session, which means you’ll have to edit the above entry at the beginning of every session. The second downside is that skippy won’t be raised if it first needs to take a snapshot of all open windows, as that takes more than a second. In such a situation, you’ll need to launch skippy twice.

Despite its limitations, I think this is rather neat :-) I am not sure who is to blame here – Pekwm or skippy – but I hope it is Pekwm because that would increase the chances that this problem gets fixed (skippy is no longer developed). If you know of a simpler way to go around this problem (or how to solve it!) please let me know.

Other uses

The potential of the screen edges is great, as you’ve probably guessed by now. Though the mouse has only a few buttons, you can combine those with modifier keys (Ctrl, Alt, Mod4), which gives you a few more options to use on the four screen edges you can play with.

Here are a few more ideas: use the screen edges to launch osdsh to display the time (osdctl -t 4), or the state of your laptop battery (osdctl -b “Battery Power”,$(acpi|cut -d “,” -f2|cut -d “%” -f1|cut -d ” ” -f2)), launch an application launcher like apwal, hide panels or taskbars like visibilty or tint that don’t support hiding (this will be a bit slower, no doubt, but it works), tile windows with tile, etc.

Frequently asked questions

January 29, 2008

I’ve added a section with some answers to frequently asked questions. These are questions that come up again and again on the Ubuntuforums or on the ‘search engine terms’ list of this blog, but that I didn’t answer (directly) in the Openbox guide. Most of these questions are also not addressed on the official Openbox FAQ. I will keep that section updated, and add to it when other questions increase in frequency.

This is just another thing I wish I had when I started exploring Openbox. Hopefully it will be helpful for all of you new Openbox users.

Follow

Get every new post delivered to your Inbox.

Join 80 other followers