Giving XFce4 a Spin

Before we begin, here’s what XFce‘s website has to say about itself: XFce is a lightweight desktop environment for unix-like operating systems. It aims to be fast and lightweight, while still being visually appealing and easy to use. It’s based on the GTK+ toolkit version 2.

1.) About XFce

XFce consists of a number of components that together provide the full functionality of the desktop environment. They are packaged separately and you can pick and choose from the available packages to create the best personal working environment.”

In its earlier versions (right upto version 3), XFce used to look a lot like CDE, the commercial desktop environment still used in Solaris. From version 4, though, its begun to develop its own look and feel.

But if you’ve got GNOME and KDE as fantastic, complete desktop environments, why use XFce? The simple answer to this is – it’s lightweight, and very fast. For users like me, who’re stuck with 6-year-old Pentium IIs, KDE and GNOME seem more or less sluggish (depending upon how much RAM you have). But XFce is blazing fast. It gives even KDE 3.2 a run for its money. (For those of you not in the know, KDE 3.2 is way faster than any of its predecessors – except for the 1.x series!) And having a small memory footrpint doesn’t mean it’s sparse. XFce4 has a lot of features and plugins, which we’ll be examining in the next few sections.

2.) How to get and install XFce:

The easiest way is to get RPMs for your distibution. For Fedora Core, go here.

Use wget, a really cool command-line based download manger that’s also scriptable.

To get the XFce4 rpms from the location above, use something like:

$ wget -nH -c -m --cut-dirs="6" -R "*.src.rpm"  http://www.moongroup.com/.../XFce4rpms/

This will put all the rpms (and not the source rpms, if any) in the directory from which this command is run.

To install XFce4, as root, type

$ rpm -Uvh ./*.rpm

Of course, if you’ve got any dependency problems (missing packages), a simple search on google for “++rpm”should do the trick. If there are any dependencies among packages, go straight ahead and use the –nodeps –force options for rpm. The purists might scream blue murder, but it works for me!

3.) Logging into XFce:

XFce is made up of a number of components, each of which must be started up individually. This is done in a shell script: /etc/XFce4/xinitrc.

You can create your own XFce4/xinitrc file too. Put all your user-specific XFce-related initialisation stuff in ~/.XFce4/xinitrc. If this file exists, it’ll be executed instead of the global file in /etc/XFce4. In fact, it might be a good idea to create this file. If you snip away all the superfluous checks and variables in the global startup file, you end up with a very very simple script. My own XFce4/xinitrc file looks like this:

#!/bin/sh
# Rahul Gaitonde's XFce4 startup script

XFce-mcs-manager
xfwm4 --daemon
#xftaskbar4&
gnome-panel&
xfdesktop&
XFce4-panel

I’ll explain in just a while why there’s the strange gnome-panel line among all the other XFce-like commands. This is a severely trimmed-version of the XFce4/xinitrc that shipped with the Fedora RPMs I use.

So what executes this script in the first place? It’s another shell script: /usr/bin/startXFce4. All this script does, is check if X is already running, and then executes either the user’s local XFce4/xinitrc file (if it exists), or the global one.

What all this means, is that to start XFce4, you need to have this line at the end of your ~/.Xclients file (for users of non-Redhat-based systems, this might mean your .xsession or .xinitrc file):

exec /usr/bin/startXFce4 || exec xterm

The last bit ensures that if XFce fails to load properly, you’ll have at least a humble xterm to work with.

Here’s how a default XFce desktop looks like (only the panel’s had some changes made to it).

Most of XFce’s settings can be changed graphically via the Settings Manager. This app can be launched by clicking on the “Setup” button on the default panel, or simply typing XFce-setting-show in a terminal window.

Click for a larger version   
Click for a larger version   
Click for a larger version

4.) The XFce panel

The most visible part of XFce is the panel. Here’s where the application launchers, pager and all kinds of plugins reside. There’s no single “Start Menu”, so this may take some getting used to, especially if you’re from the KDE/GNOME stable, or worse, a Windows refugee!

The buttons with the menus popping out of them are called, obviously, panel menus! The button itself launches one command from the menu, usually the most common of the lot. You can also have buttons without the menu attached. Just right-click on the button, and uncheck the “Attach menu to launcher” option.

On the panel, these menus are typically created category-wise. For example, you could have an “Internet” category, with the button itself launching Mozilla, and other entries being Firefox, Evolution, GAIM, among others. Another button could be the Multimedia category, with the default being XMMS and other entries being MPlayer, Rhythmbox and Totem. You’ll figure out pretty quickly how to manipulate/customise these panel menus.

These menu settings are an XML-like file in /etc/XFce4/XFce4rc (for default settings) or in ~/.XFce4/XFce4rc. Hack away at will to auto-generate these menus, if you like!

Now for the plugins – these are what give XFce its power, and there are plenty of them! A lot of them have counterparts in KDE and GNOME. Describing them all here would be repeating the information on the XFce website. Point your browser to the XFce overview page, and navigate to the bottom of the page. They’ve put up a few screenshots of the plugins.

Here is a screenshot of my panel:

The leftmost three icons are panel menus. From left to right, they are – xterm (no menu attached), Internet (Firefox default app) and Multimedia (XMMS default app).

To the right of the separator, then, is the Notes plugin. These are sticky yellow windows to type in simple text notes – exactly like Post-It notes that pile up in dozens on most refrigerators!

After this is the graphical pager. The best part is, I can drag a window previewed in the pager (for instance, the GVim window in the leftmost workspace) in the picture above, to another workspace, and it’ll actually move! The only other place where I’ve seen this kind of functionality is in Enlightenment.

The plugin after that is “Show/Hide All Windows”, followed up by buttons for the Settings Manager, Logout and another panel menu I made for halt/reboot.

The green bar is the Volume control. You can increase/decrease the volume with your mouse’s scroll wheel (another reason why I’m a huge fan of scroller mice!). The orange/yellow bars monitor network traffic – In/Out respectively. The Blue bar monitors System Load and displays the current uptime. This same plugin also monitors, if you enable it, memory and swap utilisation. To their right is a mini command-line, and the Date-and-Time plugin.

5.) Taskbar Replacement

Personally, I find the XFce taskbar too limiting. You can’t right-click on a taskbar entry and choose “Close” or “Move to Workspace X”. You can’t add plugins to the taskbar. All you can do is change its height! Why not use the GNOME panel instead?

I first saw this being implemented in a few screenshots on themedepot.org. The idea is simple – you don’t need to be running a GNOME session to run the panel (just like you don’t need to run a KDE session to use kicker, the KDE panel). I chose gnome-panel over kicker because GNOME uses the GTK2 libraries, just like XFce, so won’t need to load its own graphical toolkit libraries. Besides, the panel will use the same GTK2 theme I use for XFce, so it’ll blend in really well.

Using gnome-panel instead of the XFce taskbar is easy. In your local XFce startup script – ~/.XFce4/xinitrc, comment out the line which launches the taskbar, and add the line “gnome-panel &”, so that the relevant part looks like:

#xftaskbar4&
gnome-panel&

Now, on my gnome-panel, I not only have a more functional takbar, but I’ve moved the clock onto the panel, along with the system tray. I also have a gnome start menu in the corner:

Neat! Ah, the sheer flexibility of UNIX!

6.) The Desktop and root menu

By default, right-clicking on the desktop brings up a ‘Desktop Menu’. The structure of this menu is defined in another XML-like file: /etc/XFce4/menu.xml. This file is extensively commented, so modifying it is very easy. To personalise your desktop menu, copy this file into your ~/.XFce4/ directory, and have fun!

A middle-click on the desktop brings up a list of all opened windows ordered by workspace. It’s also a quick way to add or delete a workspace.

Scrolling on the desktop cycles through workspaces! (So does scrolling on the graphical pager in the panel). This is by far the easiest way of moving between workspaces (I have between 4 and 8 workspaces, depending on what kind of projects I’m working on). Now I’m so addicted to this, I can’t do without it.

For those of you who like lots of icons and documents on yout desktop, XFce might be a disappointment. By itself, XFce has no support for desktop icons. There are workarounds, however, in the form of dfm and iDesk.


Click for a larger version  
Click for a larger version  
Click for a larger version

7.) The File Manager, XFFM

XFce comes with its own file manager, xffm. This is one unusual animal. Although vastly improved from its predecessors in XFce versions 3.x, it’s still raw. It gives the feel of being a cross between the Rox file manager, and Midnight Commander. To be fair, it’s got a few nifty features. The first one is the ablility to browse your local Windows network. It displayed all Windows computers on my LAN accurately, but was unable to list/browse any share. The impressive part was, neither did I configure my workgroup name, nor was smb/nmb running!

Another cool feature which actually works, is the ability to browse the entries in your fstab file. Just click the fstab icon, and mount/browse your CDROM, floppy, Windows partitions, and more. Very innovative feature, I must say! There’s a built-in find feature and a bookmarks area (called “Books”).

Xffm can also find differences between files, switch between icon/columnar view, display disk usage by a particular file/directory… in short, it’s got a lot of features that are scattered in numerous places – on toolbars, in menus; there’s no consistency and it gives me the feeling of being a patchwork of features rather than a complete application. Xffm is very promising, but needs a lot of polishing before it can match Konqueror (which I personally feel is the God of all file managers), or even the “spatial” Nautilus from Gnome 2.6.

8.) Keyboard shortcuts

Here is another area which is very important to me – keyboard shortcuts. Like most users of UNIX and its derivatives, I use the keyboard a lot, and prefer launching common applications and changing frequently-changed settings via the keyboard. I’ve also been spoilt by IceWM, which had great built-in support for keyboard shortcuts.

You might be put off initially by what the XFce FAQ has to say about its support for keyboard shortcuts:

“Although xfwm4 was not designed as a general keyboard handling application you can define 10 keyboard shortcuts. If you need more consider using a specialized application like xbindkeys”.

For window-manager-specific settings, such as maximising/minimising/restoring windows, moving them about with the keyboard, I did what XFce’s FAQ told me to, but also accepted their suggestion to use xbindkeys. Just how I went about installing, configuring, customising and using xbindkeys is another issue altogether!

I accept their argument about xfwm4 not being a keyboard handling application. Strictly speaking, that’s not part of what a window manager’s supposed to do. But then I wish the developers would come up with a keyboard-handling component, say, xfkeys4 or something like that, which could be started up from within the initialisation script. Something that mimics the functionality of, say, bbkeys. Having some rudimentary keyboard handling capacity in xfwm4, and imposing an arbitrary limit of 10 shortcuts is not the way to go.

The XFce FAQ describes how to create a personal key theme:

$ mkdir -p ~/.themes/xfwm4/custom.keys/
$ cp /usr/share/xfwm4/themes/default.keys/keythemerc ~/.themes/xfwm4/custom.keys/
$ vim ~/.themes/xfwm4/custom.keys/keythemerc

The file format is pretty simple: a number of name=value pairs, one pair per line. The names for the shortcuts are pretty descriptive, like maximize_window_key. So are the names for the keys. Watch and learn is the mantra.

Then open the window manager settings dialog, go to the ‘keyboard and focus’ tab and choose your new key theme.

9.) Eye-candy!

XFce looks good! It comes with over 60 window decorations and over a dozen GTK2 themes, including a GTK2 XFce theme engine. Choose “Window Manager” from within the XFce Settings Manager to change the Window Decorations, and “User Interface” to change the theme (for all GTK2-based apps – which is why gnome-panel blends in with XFce). There are also a few icon themes to choose from, most notably the Bluecurve, Gnome, Crystal and Freeicon themes.

10.) Getting Help

The folks developing XFce have done a fine job with their documentation. The local docs, installed with the XFce4 Fedora RPMs, are in file:///usr/share/ XFce4/doc/C/index.html. There is an XFce4 User Guide plus manuals for each of the XFce4 components. These same docs are available online here. If you really like XFce and want to stay in touch with any new developments, you’ve got two options – join one of their mailing lists, or read the developers’ weblog.

11.) Concluding…

So there you are. I hope this article’s got enough in it to get your started on your own Quest of Discovery of XFce 4. The XFce developers have now put together an API for programming XFce applications. Let’s hope that this matures enough so that XFce develops a wider developer base, and consequently (due to better, more integrated applications), a wider user base.

Click for a larger version   
Click for a larger version   
Click for a larger version


If you would like to see your thoughts or experiences with technology published, please consider writing an article for OSNews.

62 Comments

  1. 2004-05-10 6:58 pm
  2. 2004-05-10 7:07 pm
  3. 2004-05-10 7:09 pm
  4. 2004-05-10 7:10 pm
  5. 2004-05-10 7:17 pm
  6. 2004-05-10 7:20 pm
  7. 2004-05-10 7:26 pm
  8. 2004-05-10 7:37 pm
  9. 2004-05-10 7:39 pm
  10. 2004-05-10 7:54 pm
  11. 2004-05-10 7:58 pm
  12. 2004-05-10 8:01 pm
  13. 2004-05-10 8:06 pm
  14. 2004-05-10 8:11 pm
  15. 2004-05-10 8:19 pm
  16. 2004-05-10 8:21 pm
  17. 2004-05-10 8:25 pm
  18. 2004-05-10 8:29 pm
  19. 2004-05-10 8:39 pm
  20. 2004-05-10 8:42 pm
  21. 2004-05-10 8:44 pm
  22. 2004-05-10 8:58 pm
  23. 2004-05-10 8:59 pm
  24. 2004-05-10 9:03 pm
  25. 2004-05-10 9:13 pm
  26. 2004-05-10 9:26 pm
  27. 2004-05-10 9:34 pm
  28. 2004-05-10 9:34 pm
  29. 2004-05-10 9:39 pm
  30. 2004-05-10 9:56 pm
  31. 2004-05-10 10:03 pm
  32. 2004-05-10 10:28 pm
  33. 2004-05-10 10:35 pm
  34. 2004-05-10 11:11 pm
  35. 2004-05-10 11:12 pm
  36. 2004-05-10 11:18 pm
  37. 2004-05-10 11:31 pm
  38. 2004-05-10 11:53 pm
  39. 2004-05-11 12:01 am
  40. 2004-05-11 12:36 am
  41. 2004-05-11 12:39 am
  42. 2004-05-11 12:47 am
  43. 2004-05-11 12:58 am
  44. 2004-05-11 1:22 am
  45. 2004-05-11 3:04 am
  46. 2004-05-11 3:07 am
  47. 2004-05-11 4:03 am
  48. 2004-05-11 8:57 am
  49. 2004-05-11 12:08 pm
  50. 2004-05-11 12:23 pm
  51. 2004-05-11 1:42 pm
  52. 2004-05-11 5:42 pm
  53. 2004-05-11 6:19 pm
  54. 2004-05-11 6:21 pm
  55. 2004-05-11 6:46 pm
  56. 2004-05-11 7:14 pm
  57. 2004-05-11 7:47 pm
  58. 2004-05-11 8:47 pm
  59. 2004-05-12 2:38 am
  60. 2004-05-12 10:23 am
  61. 2004-05-12 10:43 am
  62. 2004-05-13 10:27 pm