The Other Desktop: Running Xfce

One of Linux's greatest strengths is that it's easily customized. Although most distributions ship with a variety of standard tools for specific purposes (such as sendmail as a mail server or Vixie Cron to handle repeated jobs), alternative tools are readily available. You can rip out just about any component, either removing it entirely or replacing it with something else. Linux lets you remove or replace more components than most operating systems, allowing the savvy administrator to customize a Linux installation for specific purposes.

One of Linux’s greatest strengths is that it’s easily customized. Although most distributions ship with a variety of standard tools for specific purposes (such as sendmail as a mail server or Vixie Cron to handle repeated jobs), alternative tools are readily available. You can rip out just about any component, either removing it entirely or replacing it with something else. Linux lets you remove or replace more components than most operating systems, allowing the savvy administrator to customize a Linux installation for specific purposes.

One area that can be customized and that’s quite obvious to end-users is the desktop environment. Most Linux distributions use the K Desktop Environment (KDE) or the GNU Network Object Model Environment (GNOME) as the primary GUI. Others are available, though. At the minimal end of the scale, you can use a bare window manager, such as IceWM, Blackbox, or twm. This approach places a minimal load on system resources, but also provides a very bare-bones working environment. Another option is to use an alternative desktop environment, such as Xfce (http://www.xfce.org), XPde (http://www.xpde.com), or ROX (http://rox.sourceforge.net). Here, let’s investigate Xfce.

Why Use Xfce?

Most desktop Linux users run KDE or GNOME. Both environments offer a complete set of features and desktop utilities. So why consider anything else? Although Xfce isn’t for everybody, it does offer some unusual features and advantages over KDE and GNOME:

  • Small memory load. Xfce has a reputation as a slim desktop environment. This is still true today, but the difference is small, particularly compared to the amount of RAM in modern computers. In my own tests on a 64-bit Gentoo system, Xfce consumed about 28 MB of RAM when first started, compared to 30 MB for KDE and 41 MB for GNOME. If that 2-13 MB of RAM savings is important, using a window manager alone will save even more memory, but at the cost of reduced features. Xfce’s applets tend to consume less memory than those of its counterparts, so the memory savings of using Xfce can be greater than you might think from looking at the memory use when the environments are first launched.

  • Speed. Xfce is generally a speedy environment. Of course, using Xfce won’t improve the speed of sluggish programs such as OpenOffice.org, except insofar as its reduced memory load minimizes swapping. However, the Xfce applets and other components are often faster than their equivalents in KDE or GNOME.

  • Simplicity. Xfce is a simple desktop environment compared to GNOME or, especially, KDE. This simplicity can be a problem if Xfce lacks a feature you find important, but it can help reduce on-screen clutter, and it can make it easier to locate the features you need.

  • Configurability. Some other desktop environments can be difficult to configure in any but very simple ways (changing desktop themes, for instance). With Xfce, you can add or remove most elements, so even if the default feature doesn’t work the way you want, you may be able to substitute another program that does what you want.

  • Standards compliance. Xfce is designed to be compliant with Linux standards, including those defined at http://freedesktop.org. This feature certainly isn’t unique to Xfce (KDE and GNOME are the main focus of http://freedesktop.org, after all), but it does mean that using Xfce won’t place you too far out on the fringes in terms of interoperability with other programs.

Ultimately, the best way to decide whether Xfce is right for you is to try it. Over the past few years, the feature sets of GNOME, KDE, and Xfce have slowly converged, but they aren’t identical. You may find minor features, such as the exact window sizing and moving options in each environment’s window manager, to be more important determinants of which environment you like than the “big” features such as memory consumption.

Obtaining and Installing Xfce

Many distributions ship with Xfce, so you should check to see if it’s available in your distribution’s package set. Xfce is often installed as a set of packages, typically with names that begin with xfce or xfce4. (The current version of Xfce is 4.4.1.) Some distributions provide a simple “wrapper” package that installs most of the major Xfce packages; for instance, in Gentoo, you can install the most common Xfce packages by “emerging” the xfce4 package. GUI package tools, such as the Yum Extender (aka yumex; http://sourceforge.net/projects/yumex/) or Synaptic (http://www.nongnu.org/synaptic/) can help you locate and install Xfce using your package manager.

If your distribution lacks an official set of Xfce packages, you can download the software from its Web site, http://www.xfce.org. The site includes a Download link with pointers to binary packages for Debian, Mandriva, and OpenSUSE; a graphical binary installer for other distributions; and source code packages.

Launching Xfce

Most modern distributions automatically configure Xfce as a login option using the GDM or KDM GUI login manager when you install Xfce. Thus, launching Xfce becomes a matter of selecting it from the login manager’s menu. If you don’t see Xfce as an option, you should first try restarting your GDM or KDM session (by typing telinit 3 followed by telinit 5, or by typing /etc/init.d/xdm restart or a similar command at the comment line, depending on your distribution). This shuts down X and restarts it, so save any work and log out of your X session before doing this.

If you still don’t see Xfce as a login option, you may need to create an appropriate desktop file, such as the one shown in Listing One. (You may need to change the paths in the Exec and Icon lines to point to the correct locations.) Call this file Xfce.desktop and place it in the directory that houses your other desktop files — usually /etc/dm/Sessions, /etc/X11/Sessions, /etc/X11/gdm/Sessions, /usr/share/xsessions, /usr/X11/share/gnome/xsessions, /usr/share/apps/kdm/sessions, or /usr/local/share/kdm/sessions. If you can’t find your existing desktop files, try using your package manager or utilities such as find to locate the equivalent files for GNOME, KDE, or other environments that are accessible from your login manager.

Listing One: A sample desktop file for Xfce

[Desktop Entry]
Encoding=UTF-8
Name=Xfce
Comment=Run Xfce 4.4
Exec=/usr/local/bin/startxfce4
Icon=/usr/local/share/pixmaps/xfce4_xicon1.png
Type=Application

Alternatively, if you start X by typing startx at a text-mode login prompt, edit your X startup file (typically ~/.xinitrc). Comment out or remove any line that starts your current window manager or desktop environment and replace it with a line that reads exec startxfce4.

Configuring the Xfce Environment

Figure One shows the default Xfce desktop on a Gentoo system. (Other distributions may change some details, such as the background image.) Xfce’s basic elements should pose few surprises if you’re familiar with KDE or GNOME. The strips along the top and bottom edges of the screen are the panels, which provide access to programs and enable you to control the environment in various ways. The icons along the left edge of the screen provide quick access to the filesystem, including Xfce’s trash directory, your home directory, and the computer’s root filesystem.

Figure One: Xfce’s initial desktop display is simple but provides the basic elements most people expect

You want or need to make changes to your desktop environment, and of course this is possible with Xfce. You can adjust many features from the Settings Manager, shown in Figure Two. You can access this tool in several ways, such as right-clicking a bare section of desktop and selecting Settings& gt; Settings Manager from the resulting pop-up menu or by left-clicking the Xfce icon (the “X” with a superimposed mouse) in the bottom pane and selecting Settings& gt; Settings Manager from its menu. In either case, the individual Settings items are available from the initial Settings menu, as well. The Settings Manager is useful if you want to peruse all the available options.

Figure Two: You can adjust many Xfce and X options from the Settings Manager

Most of the items in the Settings Manager should be familiar to users of KDE, GNOME, or other GUI environments. You can set a background color or image, set keyboard repeat rates, set the number of workspaces, and so on. A few items deserve more explanation:

  • Orage. Orage is Xfce’s calendar program. You can set some key Orage options from the Orage Settings item.

  • Printing System. Xfce supports two printing systems: CUPS and BSD-LPR. Most modern Linux systems use CUPS, so you should check and, if appropriate, adjust this item. (This option only affects Xfce applications; most programs have their own means of interfacing with your printing system.)

  • Sessions and Startup. A few important options are hidden away in this item. In particular, on the Advanced tab, you’ll find options to start KDE and GNOME services when Xfce launches. Activating these features slows the login process, but speeds up the first launch of KDE or GNOME programs.

Take some time to peruse the options available among the Xfce Settings, particularly if Xfce is doing something in a way you don’t like.

You should also be aware that many Xfce tools have their own options controls, which you can adjust by right-clicking each tool’s on-screen icon. For instance, if you right-click in the on-screen clock and select Properties from the pop-up menu, you’ll be able to customize the appearance of the clock. You can move, delete, or add items to your panels by right-clicking, as well.

One particularly important type of customization relates to launching programs. The lower panel in Figure One includes launchers for a few specific applications (a terminal program, the Mousepad editor, the Thunar file manager, and a Web browser), and more are accessible from the Xfce icon on the left edge of the lower panel. You can add launchers for additional programs or turn an existing launcher into one that handles multiple programs.

To add a new launcher, right-click on the panel and select Add New Item from the pop-up menu. You can then pick Launcher from the dialog box to create a new launcher. To add items to an existing launcher, right-click on that specific launcher and select Properties. The resulting dialog box enables you to add, delete, reorder, and otherwise modify the applications accessed by a launcher. When you configure a launcher to handle multiple programs, the icon in the panel changes to include a small triangle. Click it to see a list of items. If you click on the main body of the icon, the first item is launched.

Xfce Tools and Applets

Xfce offers an array of small tools and applets that are accessible from its panels. Not all of these tools are available by default, but you can add them by customizing your panel, as just described. Some of the more major programs include:

  • Window Manager. At the core of every desktop environment is a window manager that provides the title bar and sizing controls for windows, including the decorative borders. Window managers also manage the root window– that is, the main screen. Xfce’s window manager is typical of modern window managers; it provides multiple workspaces, can roll up (“shade”) a window into its title bar, and so on.

  • Thunar. This program is Xfce’s file manager. You can use it to manipulate files, launch programs associated with particular file types, and so on. Compared to Konqueror (KDE’s combined file manager and Web browser) or even Nautilus (GNOME’s file manager), Thunar is a simple tool. If you don’t need all the features of Konqueror or Nautilus, though, Thunar may be more than adequate.

  • Mousepad. This application is Xfce’s default file editor. It’s a very simple GUI file editor, which is suitable for basic file editing but is less useful for complex tasks.

  • Xfburn. This program is a simple CD-R creation tool, similar to K3B or X-CD-Roast. (This applet is inexplicably missing from at least some distributions’ Xfce packages, including Gentoo’s.)

  • Xfmedia. This application is a media player based on Xine (http://xinehq.de). You can use it to play a wide variety of multimedia files.

Some Xfce applets don’t ship with the desktop environment by default; they come in separate add-on packages. Check http://goodies.xfce.org/projects/panel-plug-ins/start for a list of available plug-in packages. The weather tool displays an icon for the current weather conditions and brings up detailed conditions and a five-day forecast with a single mouse click. Other plug-ins may be appealing to you, such as a wireless LAN status indicator, a clipboard manager, and a battery power monitor. Check the list to learn what’s available.

Of course, these tools and applets won’t fulfill all your needs. You can configure Xfce to launch and otherwise work with other applications — even competing ones or programs that are part of other desktop environments. A default Xfce installation, in fact, is likely to provide links to such programs via the main Xfce panel item. The test system could access programs such as Abi Word (associated with GNOME), KWord (associated with KDE), and OpenOffice.org (independent) via the main Xfce panel item. You can also adjust the default applications that Xfce uses, in two ways:

  1. You can set your preferred Web browser, mail reader, and terminal program via the Preferred Applications Settings item.

  2. You can set the preferred application that Thunar uses to open a document of a particular type by right-clicking on such a document, selecting Properties, and picking the application via the Open With item. When you save your change, it applies to all items with that filename extension.

Concluding Thoughts

In use, Xfce’s main strengths are its speed and simplicity, at least compared to KDE or GNOME. If you prefer something simpler than these tools but with more features than a bare window manager, Xfce is worth investigating. Xfce’s strengths can be particularly important on older systems with less memory — but if memory is very tight, a bare window manager may be an even better choice.

Fatal error: Call to undefined function aa_author_bios() in /opt/apache/dms/b2b/linux-mag.com/site/www/htdocs/wp-content/themes/linuxmag/single.php on line 62