A DESIGNER DISTRO
Linux distros are assembled in a modular fashion, which gives you the flexibility to swap resource-draining components for faster lightweight alternatives. The most important and often wasteful component in a desktop is the window manager that controls the placement and appearance of windows within the graphical interface.
One of the most popular ones is Openbox – it’s so bare you might not even notice it’s there! All you get is a wallpaper-less background and a cursor. An application menu only appears in the right-click context menu. You can use the menu to launch applications that run within windows with the usual controls and behave as you’d expect in any desktop. You can customise the window manager using the separate obconf configurator.
Lego it up
Besides the window manager, you’ll also need a file manager. We’ll use PCMANFM, which includes several useful features like network management and an impressive context menu without taxing resources. Openbox also lacks a panel, so we’ll use the lightweight Cairo-dock and even the Xcompmgr compositing manager to add some polish to your lightweight desktop. All these components are available in the official repositories of virtually every desktop distro and can be easily pulled using your package manager. After installing the components, you’ll have to instruct Openbox to assemble them into a desktop environment.
Setting up Openbox is rather straightforward as its display and behaviour is controlled by only a handful of files. There’s the autostart file, which contains the list of the other components that the desktop will automatically run when it’s starting up. Then there’s menu.xml, which describes the content of the desktop’s right-click application menu. Openbox’s main configuration file that contains keybindings, virtual desktop settings and more is rc.xml. The global versions of these files exist under /etc/xdg/openbox.
Instead of tweaking the files there, you should first copy them to your current user’s directory with cp -R / etc/xdg/openbox ~/.config/ and then edit the startup file, like this:
$ nano ~/.config/openbox/autostart pcmanfm --desktop & sleep 2s pcmanfm --set-wallpaper=/home/bodhi/pictures/ wallpaper.jpg --wallpaper-mode=crop cairo-dock -o & xcompmgr -c -f &
In this file we’ve first invoked PCMANFM as the desktop manager. By default, PCMANFM will display icons for all files and folders in the ~/Desktop folder. If you want shortcuts for applications on your desktop, you need to copy the respective .desktop files from /usr/share/applications into the Desktop folder. The & symbol at the end of some lines tells the distro to run the program in the background and move on to the next item. Without this symbol, the distro would run the first line and wait until that program was completed before running the next line, which would prevent our desktop from loading.
We then pause the script for two seconds for
PCMANFM to settle down, before we invoke it again to draw the wallpaper. Next we use the -o option to force Cairo-dock to use the hardware-accelerated Opengl backend. The last line calls xcompmgr along with support for soft shadows and translucency. It also enables a smooth fade effect when you hide and restore windows.
That’s all there is to it. Now log out and log back in, but make sure you change your desktop environment to Openbox in the login manager. Now enter your authentication details and you’ll be logged in to your custom Openbox-managed desktop.
You can now spend some time configuring individual pieces such as cairo-dock and even Openbox itself to your liking. Once you get the hang of creating custom desktops, you can replace components with alternatives. Try different docks, place widgets on the desktop with gdesklets, Conky or Gkrellm, or perhaps even an application launcher like Synapse. Ultimately, there’s no better way to hack your way to a pleasantlooking desktop.