I have never used Windows Vista or Windows 7, but from what I’ve learned from others it seems to have one really neat feature: Aero snap. If you drag a window to a screen edge that window will fill half of the available screen space. Tiling two windows is extremely easy with this. You can comfortably view two documents at the same time without losing much screen estate.

Now that I am using Pekwm again, I tried to replicate this behaviour with this window manager. One of Pekwm’s neatest features is its use of screen edges: you can assign mouse actions to the edges of the screen.

Could we use those screen edges to get a window to take up half of the screen space? One of the mouse actions you can use with the screen edges is “EnterMoving”, a mouse event that is only used for the screen edges. As the documentation states, this action “defines how to act when a dragged window enters a ScreenEdge”. The default action assigned to this action is “WarpToWorkspace”; if you drag a window to the left screen edge, the window will be moved to the workspace on the left.

I rarely use this feature, so I lose little by assigning a different action to this mouse binding. I initially tried to use Pekwm’s own window management actions to resize a window that I dragged to a screen edge, but that did not seem to work. But luckily there is wmctrl, a little tool that can manipulate windows managed by standard compliant window managers (like pekwm), from the command line.

Wmctrl is in the repositories of most distributions. If you use Debian or Ubuntu (or one of its derivatives), you can install it with the following command:

sudo aptitude install wmctrl

Once you have wmctrl installed, you have to reconfigure Pekwm’s mouse behaviour, by editing the ~/.pekwm/mouse file which governs all mouse actions. In the ScreenEdge section you’ll find the settings for each of the four screen edges. Look for the line that begins EnterMoving = “Any Any” in each of those section. This is what we will modify (or create if it doesn’t have that behaviour mapped yet for a screen edge).

The wmctrl commands we will use are specific to a particular screen size. The settings I give below are for my desktop screen, which has a 2048×1152 resolution, and for my laptop screen, which has a 1028×768 resolution. If you have a screen of a different size, you’ll have to modify this (I’ll explain how later).

For a 2048×1152 resolution

In the Down section, I have the following:

EnterMoving = "Any Any" { Actions = "Exec wmctrl -r :ACTIVE: -e 0,0,627,2048,550 &" }

In the Up section, I have the following:

EnterMoving = "Any Any" { Actions = "Exec wmctrl -r :ACTIVE: -e 0,0,0,2048,542 &" }

In the Left section:

EnterMoving = "Any Any" { Actions = "Exec wmctrl -r :ACTIVE: -e 0,0,0,1024,1152 &" }

And in the Right section, I have the following:

EnterMoving = "Any Any" { Actions = "Exec wmctrl -r :ACTIVE: -e 0,1025,0,1024,1152 &" }

For a 1028×768 resolution

In the Down section, I have the following:

EnterMoving = "Any Any" { Actions = "Exec wmctrl -r :ACTIVE: -e 0,0,412,1028,324 &" }

In the Up section, I have the following:

EnterMoving = "Any Any" { Actions = "Exec wmctrl -r :ACTIVE: -e 0,0,0,1028,384 &" }

In the Left section:

EnterMoving = "Any Any" { Actions = "Exec wmctrl -r :ACTIVE: -e 0,0,0,513,768 &" }

And in the Right section, I have the following:

EnterMoving = "Any Any" { Actions = "Exec wmctrl -r :ACTIVE: -e 0,513,0,513,768 &" }

These settings work as follows: If I drag a window to the right or left screen edge, it takes up the right or left half of the screen. If I drag it to the top or bottom edge, the window will tile vertically and take up the top or bottom half of the screen. These last settings are a little more troublesome, as you need to take the window decorations into consideration. The above settings are based on the Infinity Pekwm theme. If I were to use a different theme, that has smaller or bigger window decorations, I’ll have to adjust these settings by a few pixels so that the windows will not overlap. Since I very rarely use the vertical tiling (where the biggest changes would have to be made to account for the theme’s window decorations), I am not really bothered by this.

If you have to adjust these settings for your own screen size, it probably helps to know the syntax of the wmctrl command I use above. Let’s use the command for the Left screen edge as an example:

wmctrl -r :ACTIVE: -e 0,0,0,1024,1152

-r :ACTIVE: tells wmctrl to do something with the active window, which would be the window you are dragging into the screen edge. -e, then, tells wmctrl that you want to move and resize the window, according to the values given in the rest of the command, using the following syntax as explained in wmctrl man’s page: g,x,y,w,h.

  • g stands for the gravity. I’m not entirely sure what this does (you can read up on it on the EWMH standards documentation, if you like), but if you use the value 0 for this, it works.
  • x and y determine where the window will be positioned. For the left screen edge this is 0,0, as we want the window in the top left corner. For the right screen edge, this should be 0,half-of-your-horizontal-resolution as you want the window to be positioned at the top of the screen (the 0 value for x), but only beginning from a pixel after the middle of the screen (if you would start from the middle of the screen, it would overlap by a pixel the left window). In my case this is 1025 (half of 2048 + 1). For a 1024×768 screen resolution, this would be 513 (half of 1024 + 1). For the top and bottom edges you would set 0,0 for your top edge (as you want the window to placed in the top right corner), and 0,half-of-your-vertical-resolution for the bottom edge, as you want it to be placed in the middle of your screen.
  • The final two values (w and h) tell wmctrl how to resize the window: how wide and high it should be. For the left and right screen edges, you would want it to fill half of the screen horizontally, and to fill the entire screen vertically, so you would set the first value to half of your screen size (in my case 1024), and the second value to the size of your screen width (in my case 1152). For the top and bottom screen edges, you would reverse these values: the first would be the entire width of your screen (in my case 2048) and half of your vertical screen size, minus the size of your window decorations, as I mentioned before. You could, of course, also adjust the positioning of these windows, by adjusting the previous values.

Make sure that you did not delete the & sign at the end of the action in your configuration file. Once you have configured this for your screen, save your ~/.pekwm/mouse and reconfigure Pekwm. If you drag a window to one of the screen edges now, it should “snap” as it would in Aero (or, since I’ve never used Aero, as I think it would snap in Aero).

The standard Openbox does not make use of the screen edges, so you can’t accomplish this with Openbox, but you could assign these commands to keybindings and do so manually. But in Openbox, you would probably want to use Openbox’ own actions, instead of wmctrl. Have a look at this post for ideas on how to set this up.

A Pekwm Guide

May 10, 2012

What follows is not a new guide. I wrote this a long time ago, for the Ubuntu forums, but was recently informed that the “Howto” section of the Ubuntu forums is being deprecated, in favour of the Ubuntu Wiki. I decided to save it here, for easier reference. I’ve updated the guide to make it relevant for Debian as well as the current Pekwm version.

Contents

  1. Introduction
  2. Installing Pekwm
  3. Creating a Session entry for Pekwm
  4. Pekwm basics
  5. Configuring Pekwm
  6. Pekwm themes
  7. Conclusion

1. Introduction

Pekwm is a fast, functional, and flexible window manager, originally based on aewm++. It supports tabbed windows (like Fluxbox), key chains, pixmap themes, xinerama support and much more. If you like Fluxbox or Openbox chances are you’ll like Pekwm too, as it resembles both in looks and functionality. Pekwm is still actively developped.

Here is what Pekwm can look like:


(The first screenshot uses the Groove Pekwm and Gtk theme; the second uses the Fearless Pekwm theme and a modified Royalty gtk theme; the third uses the Elegance Pekwm theme.)

Pekwm has excellent documentation, which you can find here. Everything you need to know to use Pekwm can be found there, and though it can be daunting at times I strongly recommend reading it. This guide is not meant to repeat or replace the official documentation, but rather to help users new to Pekwm getting started.

2. Installing Pekwm

The latest version of Pewkm (0.1.14) is both in the repositories of Debian Wheezy and Sid, as well as those of Ubuntu Quantal. Installing Pekwm 0.1.14 on Debian Wheezy and Sid, or Ubuntu Quantal (or distributions based on these) is, in other words, very easy. Just install the package through Synaptic, or through a terminal (sudo aptitude install pekwm).

2.2 Building Pekwm from source

Older versions of Debian or Ubuntu have older versions of Pekwm in their repositories. If you use one of those, or if you prefer to build from source, you can get Pekwm installed in just a few steps. Here is how to do it.

  • Preparation
    Since you will have to build from source, you will need the basic building tools installed. If you have never build a package from source before, you’ll have to install build-essential. I also recommend installing checkinstall, as it makes it much easier to remove the package you’ve installed later on. Checkinstall will first create a .deb package and install that. This means that it will show up in Synaptic and can be removed with Apt or Aptitude.

    You can install these two packages with the following command:

    sudo aptitude install build-essential checkinstall

    Next install the needed dependencies for Pekwm:

    sudo apt-get build-dep pekwm

  • Download the source code from the Pekwm site.
    Use your favourite web browser to surf to the Pekwm site and click on the download link for Pekwm 0.1.14 to download the latest stable version, or download it with the following command:

    wget https://www.pekwm.org/projects/pekwm/files/pekwm-0.1.14.tar.bz2

  • Unpack the archive
    Once the source code archive has been downloaded, it is time to unpack it. Use a file browser to navigate to the directory where you saved the file and unpack the archive to the directory of your choice. Alternatively, you can use the command line as follows:

    cd /path/to/the/directory/where/the/archive/is/saved
    tar xjvf pekwm-0.1.14.tar.bz2

  • Configure the package to make it ready to compile
    Now you have to compile the package. Open a terminal and navigate with the cd (‘change directory’) command to the directory where the unpacked archive is:

    cd pekwm-0.1.14

    Then run the configure script to prepare the source for installation with the following command:

    ./configure

    You can add several options to this. Using this command, the package will be installed in /usr/local/. If you’d like the package to be installed in another directory, for example /usr/, use the following command:

    ./configure --prefix='/usr'

    There are more options (see here), but unless you really know what you are doing, you need not be concerned with them.

    The configure script will look for dependencies and basic system settings. Just let it all run. You don’t need to worry about what it tells you, unless you encounter an error and the process is aborted: only the first error message is then of importance as it will help you figure out what went wrong. If all goes well, you should see something like this:

    * pekwm version 0.1.14 configured successfully.
    *
    * PREFIX: /usr/local
    * FEATURES:  XShape Xrandr Xft image-xpm image-png menus harbour
    * CXXFLAGS: -g -O2  -I/usr/include -I/usr/include/freetype2
    * LIBS:   -L/usr/X11R6/lib -lX11 -lXext -lXrandr -lXft -lX11 -lfreetype -lz -lfontconfig -lXrender -lX11 -lXpm -lpng

    If you changed the destination directory, as explained above, the ‘PREFIX’ line will give the directory you specified. You can ignore the rest.

  • Build the package
    Once all this is done, you have to build the package. At the command prompt type the following command:

    make

    A lot of information will appear. If no errors show up, none of it is really important and can safely be ignored. Note that this may take a while.

  • Install Pekwm
    If all this went smoothly and no errors were encountered, you can finally install the package with the following command:

    sudo checkinstall

    (If you prefer not to use checkinstall, type ‘sudo make install’ instead.)

    Checkinstall will then build a .deb package and install that. If you’d rather build the .deb now, but install the package later using that deb, enter the following command instead to install:

    sudo checkinstall -D

    Checkinstall will ask for confirmations three times in the beginning of the process, so keep an eye on it. The defaults are fine, so you can just press enter when it asks for something.

    If all goes well, Pekwm is now installed. If you encounter any error messages in this process, post them in here, and perhaps someone can help.

3. Creating a Session entry for Pekwm

If you have installed the Pekwm package from the repositories, you can skip this step.

If you compiled Pekwm from source and if you use a display and session manager, such as GDM, KDM or Slim, you will not have an entry for Pekwm in the Sessions menu of your login screen. But don’t worry, this is easily created. Open a terminal and enter the following command (you can replace nano by any other text editor, such as mousepad, leafpad, vim or gedit):

sudo nano /usr/share/xsessions/Pekwm.desktop

An empty file will open. Add the following to this:

[Desktop Entry] 
Encoding=UTF-8 
Name=PekWM
Comment=Start PekWM
Exec=/usr/local/bin/pekwm
Icon= 
Type=Application

(If you have installed Pekwm to /usr/ (as mentioned above), change the Exec line to ‘Exec=/usr/bin/pekwm’)

Save and close the file and make the file executable with the following command:

sudo chmod +x /usr/share/xsessions/Pekwm.desktop

When you restart your computer, you will be able to choose Pekwm in the sessions menu (which is accessed with F10 > Sessions if you use GDM or KDM, or whatever other display manager your distro uses).

If you don’t use a session manager, edit your ~/.xinitrc file (create one if you don’t have one already), so that it looks something like this:

#!/bin/sh
xsetroot -solid black &

exec /usr/local/bin/pekwm

If you have installed Pekwm to /usr/ (as mentioned above), change the exec line to ‘exec /usr/bin/pekwm’. When you start X with the command startx you will start a new Pekwm session.

4. Pekwm basics

When you first log into Pekwm, you won’t see much apart from a blank screen. This is normal. Pekwm doesn’t come with a panel, or a desktop manager. Pekwm is fairly straightforward. It is a window manager, and does not do much more than managing windows. Here are a few basics of Pekwm:

Windows

  • Pekwm supports tabbed windows. You can group windows together by middle-clicking the titlebar of one window and dragging it to another window title. To group the next launched window with the current one, press the windows key + T to tag the current window. Until untagged with the same command, all new windows will be opened as tabs within that window.

  • Apart from maximizing, windows can also ‘fill’ in Pekwm: they will grow (either vertically, horizontally or both) until they reach another window border or an edge of the screen.

  • Every window can be stripped of their titlebar or their borders or both.

Menus

  • Pekwm comes with several menus. You have the root menu, which is editable and generally contains entries to launch your applications. There is a active window menu (the GoTo menu), which contains a list of all active windows on all workspaces. The GoToClient menu list all active windows with their tabs. The Icon menu lists the iconified windows.

  • Right click on the desktop, and you’ll have your root menu. Middle click and you have the active window menu. You can also click on the screen edges to call up these menus, which means you don’t have to iconify all windows to use the menu.

  • To see the Icon menu, press Windows key+Shift+I, to use the GoToClient menu, press Windows key+C

Other

  • Pekwm does not come with any panels, pagers, system trays. It does have a ‘harbour’, where you can load dockapps, and which is similar to (though less developed than) the slit of Fluxbox or the dock of Openbox. The order in which the dockapps are loaded can be specified in the autoproperties file (see below).

  • Pekwm has a command dialog, which can be launched by pressing the Windows key + D. It can be used to execute commands to launch applications, but also to performs Pekwm actions. For a list of actions, see here.

5. Configuring Pekwm

All of Pekwm’s configuration happens in the ~/.pekwm directory. In there you will find 7 files: config, menu, keys, mouse, autoproperties, start, and vars.

There are no graphical tools to change the settings in these files (apart from a text editor ;-)). Any changes you make to these files will not be applied until you reconfigure (in the root menu) or restart Pekwm.

In case you accidentally delete these files, the defaults can be found at /usr/local/etc/pekwm

Config
This is the general configuration file. Here you can control the basic behaviour of Pekwm. It controls the workspace settings, the menu and harbour behaviour, window edge resistance, and more. The settings are very well explained in the official Pekwm documentation.

Menu
As you could have guessed, this is the file that controls your menu. You can edit this file to add, edit or remove entries or submenus to your root menu and (towards the end of the file) your window menu (the menu that pops up when you right click a window header). Any custom menu you’d like to setup will have to be added to this file.

When you first run Pekwm you will already have a rather full default menu, with possibly plenty of applications you don’t have installed. It might be a useful basis to create your own menu. You could also run Menumaker to set up menus of all your installed applications. Run it with the following command:

mmaker --no-desktop pekwm

(Note that this will not overwrite your existing menu file. If you want it to overwrite, add the -f flag to the above command.

The syntax for the menu file is fairly straightforward. A simple entry has the following structure:

Entry = "NAME" { Actions = "Exec COMMAND &" }

A submenu has the following syntax:

Submenu = "NAME" {
		Entry = "NAME" { Actions = "Exec COMMAND &" }
		Entry = "NAME" { Actions = "Exec COMMAND &" }
}

(Make sure these brackets are always closed, or you will have errors and your menu will not display)

To add a separator line to the menu, use the following:

Separator {}

Pekwm also supports dynamic menus. These are basically menu entries or submenus that display the output of a script that is run every time the entry or submenu is accessed.

You can find some dynamic menus online. Check the exact syntax the menu requires, as they can vary. There are not that many dynamic menu scripts around, unfortunately. You can find and example of a dynamic menu, used to display the time and date, here.

Keys
This file controls all the keyboard bindings and keychains used in Pekwm. You can add keyboard bindings to launch programs or to perform actions in Pekwm, such as show a menu, move a window, switch desktops, etc. For a full list of Pekwm’s actions, see the documentation.

The syntax structure of this file resembles that of the menu file and should be fairly self-evident. Mod1 is the Alt key, Mod4 the Windows key.

You can have more than one action assigned to one key combination. To do so, just separate the actions by a semicolon. Here is an example:

KeyPress = "Ctrl Mod1 R" { Actions = "Exec osdctl -s 'Reconfiguring'; Reload" }

When you press Ctrl+Alt+R Pekwm will display on the screen the text ‘Reconfiguring’ (osdctl -s ‘Reconfiguring’) and reconfigure (Reload). (Note that this requires osdsh to be installed)

Mouse
This file controls all the mouse actions used in Pekwm. For a full list of Pekwm’s actions, see the documentation.

Pekwm is set up by default to focus windows when the mouse moves over them (as opposed to the ‘click to focus’ style). If you’d like to change this, look for the following lines in the file and do what they say (there are quite a few of the first, but only one occurrence of the second):

# Remove the following line if you want to use click to focus.
# Uncomment the following line if windows should raise when clicked.

For some ideas of what you can do with the Mouse and Keys file, have a look here.

Autoproperties
If you’d like certain applications to open on certain workspaces, have a certain title, skip the (window) menus, or be automatically tabbed together, you can specify all that here. The syntax is a little confusing at first, but it is well documented in the documentation and the default autoproperties file contains plenty of examples.

For example, to have Opera start maximized and without titlebar, you would use the following setting:

Property = "^opera,^Opera" {
 	ApplyOn = "Start New"
 	Border = "True"; Titlebar = "False"
	MaximizedHorizontal = "True"; MaximizedVertical = "True"
}

Start
This file is used to start applications when Pekwm is started. If you’d like to display a wallpaper or launch a panel whenever Pekwm is started, you can add entries for these things here. Note, though, that these applications are run every time Pekwm is started — including when you run ‘Restart’ in the root menu. The commands are executed only after Pekwm is started.

To add an application, use the following structure:

nameofapplication &

The & at the end is crucial, or anything after it won’t be run. To give you an idea of what this file could look like, here is an example:

# Auto-mounting drives 
gnome-volume-manager & 
# To set the background image
hsetroot -tile "/home/urukrama/Images/Desktops/Abandoned.jpg" &
fbpanel &
conky &
# To have visual feedback when changing the volume
osdsh & 
(sleep 1 && osdctl -m 1) &

Before you can use this file, you will have to make it executable with the following command:

chmod +x ~/.pekwm/start

Vars
Finally, the vars file contains variables that are applied throughout Pekwm. The default entry should be clear enough:

$TERM="xterm -fn fixed +sb -bg white -fg black"

Whenever the variable $TERM is used in any of Pekwm’s configuration files, the command xterm -fn fixed +sb -bg white -fg black will be run.

6. Themes

Unlike some other window managers, Pekwm themes govern all visual aspects: window headers and borders, menus, the harbour, fonts, as well as the position and functions of window buttons (like close, iconify, etc.).

Themes are installed in ~/.pekwm/themes or /usr/local/share/pewkm/themes (/usr/share/pekwm/themes if you have changed the default installation directory). To install a theme, unpack the theme archive, and copy the folder that contains the ‘theme’ file and possibly image files to the above mentioned folders. The name of the theme folder is the name that will appear in the menu. You can change the theme also manually by editing the Pekwm config file (in the first section ‘Files’).

You can download pekwm themes from Box-look. The theme settings have changed in more recent versions of Pekwm, so themes written for older versions are most likely unusable. You’ll be able to tell straight away whether a theme is broken or not. :-)

7. Conclusion

Since Pekwm is just a window manager, it doesn’t control the desktop, provide ways of changing Gtk settings such as themes, icons or fonts, manage the (un)mounting of devices, etc. Solutions to these are the same in Pekwm as in Fluxbox, Openbox or Icewm. If you need help with these, have a look at my Openbox guide, which discusses these at length.

Like Fluxbox and Openbox, Pekwm is small and light, but highly configurable. Explore its many potentials and find a setup that works for you.

For additional support of Pekwm read the documentation, join the mailing list, or enter #pekwm at irc.freenode.net.

Probably more for my own amusement (especially in a year’s time) than for anyone else’s, and in an attempt to document the evolution of my aesthetics, I here give a summary of my own 2008, in screenshots.

The wallpapers I use for my desktops generally reflect my mood, and have some special significance for me at the time. What follows is therefore not just a collection of screenshots, but a reflection of what has been on my mind the last year. Not all the screenshots I’ve taken the past year are here. I’ve left out the odd desktops (like this one or this one) that didn’t last very long.

The screenshots are arranged per computer, roughly chronologically. Yantra is my main computer, on which I do most of my work. Grantha is the computer at my office. Mitra is the old Dell Inspiron 2500 laptop I wrote about earlier.

Most of the screenshots are of Openbox, which I started using in early 2007 (if my memory serves me well…). By the end of 2007, I discovered Pekwm and used that window manager almost exclusively for a few months in the beginning of 2008. In the summer, I started experimenting with Awesome 2.3, which became the standard window manager on one of my computers (mitra), and which I use frequently on another (yantra). All of these screenshots are of Debian or Ubuntu systems. Early in 2008, grantha still ran Windows XP, but that now runs Debian Testing (lenny). One of the early mitra screenshots may be one of Arch Linux, which I had installed on that laptop for a few weeks when I just started using it.

I’ve been using the same themes on grantha and mitra for months now (see the last screenshots for both). The themes on yantra tend to change more often, though I’ve been alternating a lot the last few months between the Children of the Earth themes and the Mythos theme.

I’ve had a lot of dark desktops this year, and have used a couple of dark Gtk themes often (Royalty, Mythos and Eidolon). It really is very pleasant on the eyes, especially at night, even if not all websites go well with it.

For all of you with a slow internet connection: know that this is quite a lengthy post, with more than 40 300×225 thumbnails!

Read the rest of this entry »

As is probably clear to the reader of this blog, I mainly use two window managers: Pekwm and Openbox. Both look very differently on this computer, though. My Openbox session is dark blue and purple; my Pekwm session, on the other hand, looks orange and black.

Up until very recently, the first thing I often had to do after I logged into either sessions, was to edit the .gtkrc-2.0 file and (re)set the appropriate Gtk theme settings. I have suggested elsewhere to use both the xfce-mcs-manager and the gnome-settings-daemon to avoid clashing themes between sessions, but I prefer not to load these daemons.

Here is my current solution. First, I created two new gtkrc files that contain the Gtk settings I use in Openbox and Pekwm: ~/.gtkrc-2.0.Openbox and ~/.gtkrc-2.0.Pekwm. I then added the following line to my (auto)start file to overwrite the default ~/.gtkrc-2.0 file with the gtkrc file for Pekmw/Openbox:

For Openbox:

	cp /home/USERNAME/.gtkrc-2.0.Openbox /home/USERNAME/.gtkrc-2.0 &

For Pekwm:

	cp /home/USERNAME/.gtkrc-2.0.Pekwm /home/USERNAME/.gtkrc-2.0 &

And voilà! No more Gtk settings that conflict with the Pekwm/Openbox theme or wallpaper. This solution is probably very obvious to many, but perhaps some of you will find it helpful. This will, of course, also work if you use Openbox and a destkop environment (as separate sessions); just uncomment everything your custom Gnome/Xfce gtkrc file (as above), so that its daemon can set the themes properly.

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.

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.

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.

A simple Pekwm guide

January 10, 2008

I have posted a simple guide to install and configure Pekwm on the Ubuntuforums.

Don’t expect anything extraordinary. I only tried to help those new to Pekwm to install the latest stable version and give them some hints of what Pekwm can do. If you know the official documentation of Pekwm, this little guide will not contain anything new for you.

I’m in the mood to post a picture, so here is the Pekwm howto in Epiphany, with the black ubuntuforums userstyle:

Free Image Hosting at www.ImageShack.us

Hopefully this will create some more interest in Pekwm among Ubuntu users, so that when I run into problems, there is someone to help me ;-) .

If you have any feedback on the guide, I am, as usual, very happy to hear from you.

Follow

Get every new post delivered to your Inbox.

Join 79 other followers