The Xfce Configuration Guide Joshua Saddler This guide provides an extensive introduction to Xfce, a fast, lightweight, full-featured desktop environment. 1.0 2007-01-09 Introduction
The Xfce desktop environment

Xfce is a fast, lightweight desktop environment for Unix-like operating systems. It is designed for productivity, and is quite configurable while still adhering to the Freedesktop specifications.

Unlike heavier desktop environments, such as Gnome and KDE, Xfce uses far fewer system resources. Additionally, it offers greater modularity and fewer dependencies; it takes up less space on your hard disk and takes less time to install.

This guide will not only show you how to install and configure a minimal Xfce environment, but will also explore options to create a full-featured desktop in keeping with the Xfce philosophy: light, fast, and modular.

Installing Xfce
The basics

Before we install our fully-functional yet minimal desktop, let's take a moment to review the basic packages we'll be emerging.

xfce4The base Xfce desktop environmentxscreensaver A screensaver with powersaving features and the ability to lock the screen for security hal A Hardware Abstraction Layer. HAL enables desktop applications to locate and use hardware devices. This makes it easy for you to work with removable media, such as USB sticks and CD/DVD drives. Installing hal will also install dbus, a simple way for applications to talk to each other. gamin This file alteration monitor keeps track of file changes; it's very handy when used in conjunction with a graphical file browser.
Name Description

You're free to install any other packages you wish, but for now, we'll stick with these suggestions for a fast, minimal working environment. Double check your USE flags in /etc/make.conf to suit your needs, though you'll probably at least want USE="-gnome" to avoid pulling in unnecessary dependencies.

# emerge -avt xfce4 xscreensaver hal gamin

Next, add your regular user(s) to the following groups, so that they can take full advantage of hal and be able to mount and use devices such as cameras, CD-ROMs, CD-RWs, and USB sticks:

(Remember to replace username with your actual user)
# gpasswd -a username plugdev,cdrom,cdrw,usb

Next, update your environment variables:

# env-update && source /etc/profile

Now start up hald and add it to the default runlevel:

# /etc/init.d/hald start
# rc-update add hald default
Configuring Xfce
Starting Xfce

Now that Xfce is now installed, we'll configure it to be the default desktop environment when we issue the startx command. Exit your root shell and log on as a regular user.

$ echo "exec startxfce4" > ~/.xinitrc

Now start your graphical environment by typing startx:

$ startx

Congratulations, and welcome to your new Xfce desktop environment. Go ahead, explore it a bit. Then continue reading to learn how you can configure Xfce to suit your needs.

Program access

You might notice right-clicking on the desktop shows you the menu of all your applications. It's useful, but your desktop can easily be completely obscured by open windows, making it hard to to launch a new program. So, one of the first things you may wish to do is give yourself a handy application menu on your panel. Right click on this panel, and choose "Add New Item". Scroll through the list of choices and select "Xfce Menu". You can choose where you want it to be displayed on your panel. When clicked, it displays the application/preferences menu, providing a nicely categorized list of your installed programs.

Sessions & startup

If you've installed (or plan to install) popular Gnome or KDE applications such as k3b, nautilus, kmail, evolution, etc. then you should make sure that Xfce launches the appropriate services for these at startup. Navigate to Menu --> Settings --> Sessions & Startup. On the "Advanced" tab, select the appropriate checkbox. This might slightly increase Xfce startup times, but it decreases load times for KDE and Gnome applications.

Xfce has the ability to save your session settings and running programs from the "General" tab in the Sessions & Startup menu. They can be automatically saved when you logout, or Xfce can ask you each time. This feature is particularly useful for undoing configuration mistakes. Accidentally killed a panel? Just select "No" when prompted to save your current session, and the next time you start Xfce, your old desktop is restored. Want to automatically launch your open webbrowser, terminal, and email client the next time you login? Just save your session before logging out.

You've now got a basic working environment installed and configured. But if you're interested in doing more, then continue reading!

Additional Applications
Panel plugins

In this chapter, we'll discuss some useful plugins and applications for everyday use within Xfce.

There are many plugins for the panel available in Portage; see for yourself with emerge --search xfce. Though for the most part their names are self explanatory, a few deserve some attention, as they are quite helpful. To use them, simply emerge them. They'll be added to the list of available items in the "Add New Item" menu.

  • xfce4-mount gives you a handy method of mounting devices listed in /etc/fstab just by clicking your mouse
  • xfce4-taskbar can replace the windowlist panel entirely. It's useful if you want to conserve screen space (for small monitors), or don't want your desktop cluttered with more than one panel. Add the taskbar to your main panel, and then you can remove the separate windowlist panel by running killall -9 xftaskbar4 from an xterm, thus displaying your application launchers, Xfce menu, clock, etc. all on just one panel.
  • xfce4-battery is perfect for laptop users. It displays battery percentage, time remaining, power source (AC or battery), fan status, warnings, and can even be configured to execute commands at certain power levels. This feature can be used to put the laptop into hibernate mode when the battery is almost exhausted.
  • xfce4-minicmd is a small command line embedded into the panel. It's quicker than opening up another terminal when you want to run a command.
Useful programs

Now let's see about adding some useful yet lightweight applications, in keeping with Xfce's philosophy.

First, let's replace the plain, boring old xterm with xfce-extra/terminal. Terminal is far more configurable and useful than xterm, and supports Unicode text, pseudo-transparency and accelerated transparency via Xfce's built-in compositor, all out-of-the-box. At the time of writing, it is still in ~arch, so you will need to add it to /etc/portage/package.keywords before emerging it.

# echo "xfce-extra/terminal" >> /etc/portage/package.keywords
# emerge -av xfce-extra/terminal

Once it's installed, you may want to change the default action of the terminal launcher on your panel to run /usr/bin/Terminal instead. Just right-click the launcher and choose "Properties" to change the command.

You may want to replace the rather confusing default filemanager, xffm, with one that's more intuitive and helpful. The rox file manager is icon-based and behaves much more like a traditional file manager. If you're looking for something even more minimal, yet still extremely flexible, then try out the gentoo file manager. (The gentoo file manager is not related to the Gentoo Linux distribution.) Both file managers are lightweight and fully configurable, and are only a short emerge away.

In the future, thunar will replace xffm as Xfce's default file manager, but it is still masked at the time of this writing. However, the most recent versions have been quite useful for daily work, and show great promise. If you're feeling brave, you can try out the release candidates. Please read Using Masked Packages to learn how to unmask it and its dependencies. Note that this software is still unfinished. You have been warned!

Let's install a simple graphical text editor. It's easier to use than gvim or xemacs, and has fewer dependencies.

# emerge mousepad

If you need a full-featured word processor but don't want the bloat of OpenOffice, try emerging abiword. AbiWord is lighter, faster, and is completely interoperable with industry-standard document types.

# emerge -avt abiword

Need a nice email client/newsreader that isn't as demanding as mozilla-thunderbird or evolution? Try sylpheed-claws:

# emerge -avt sylpheed-claws

For your internet chat needs, irssi is an excellent, tiny, incredibly configurable IRC client that runs in your terminal. If you prefer a compact all-in-one client that handles nearly all chat protocols, you may want to emerge gaim.

If you need movie and music players, look no further than mplayer and audacious. They can play most every media format available quite nicely, and have a wealth of additional plugins available for additional functionality.

Finally, you'll need a webbrowser. Nearly all graphical webbrowsers require more resources than most of your other desktop applications. Still, mozilla-firefox (or mozilla-firefox-bin) is always a good choice. Alternatively, you may find opera to be quite fast. However, opera is not available on as many processor architectures as mozilla-firefox, and it has more dependencies unless you override them with a USE flag.

(Installing Mozilla Firefox)
# emerge mozilla-firefox
(Installing Opera)
# echo "www-client/opera qt-static" >> /etc/portage/package.use
# emerge opera

Now that we've explored some good suggestions for rounding out your desktop applications, let's see what else we can do to enhance your Xfce experience.

Graphical login

Remember when we added startxfce4 to our ~/.xinitrc? All you have to do to get into your desktop is type startx after logging in. This is fine if you prefer a completely text-based boot and login, but let's use a display manager that will automatically start Xfce after booting (so that you can login graphically). First, let's make sure Xfce loads at boot:

# rc-update add xdm default

We aren't quite finished yet. We have to pick a display manager and set the appropriate variable. Though there are a few choices available in Portage, for this guide, we'll stick with two display manager options: xdm and gdm.

xdm comes with your installation of xorg-x11, but it isn't pretty, and isn't really customizable. On the other hand, there's nothing further to install; it's ready to go. If you'd like to use it, then just edit the DISPLAYMANAGER variable in /etc/conf.d/xdm:

DISPLAYMANAGER="xdm"

While you can choose to stick with (the rather ugly) xdm, why not try gdm instead? It's far more configurable, and much, much prettier. First, let's emerge it. Note that though it has a few dependencies, they're small, and they're not as nearly as numerous as other display managers.

# emerge -avt gdm

Next, change the DISPLAYMANAGER variable to use gdm instead of xdm:

DISPLAYMANAGER="gdm"
Beautifying your desktop

A little customization of your desktop's appearance can go a long way. Xfce has all the options you'd expect from a modern desktop environment, font antialiasing settings, color schemes, dozens of window decorations, themes, and more. If these aren't enough, it's easy to install third-party themes, icon sets, mouse cursor themes, and wallpapers.

A selection of nice Gentoo wallpapers in a variety of resolutions are hosted on the Gentoo website. If you're looking for icon sets and complete Xfce themes, Xfce-Look has a huge collection. The important thing to remember about any third-party eyecandy you download is that it will usually first need to be unpacked and then installed to the proper directory. Icon sets go in /usr/share/icons/, and themes go to /usr/share/themes/.

If you installed GDM as your display manager, take a look at the many GDM themes available on Gnome-Look. To install them, you can either unpack and move them to /usr/share/gdm/themes/ on the command line, or you can run gdmsetup as root and drag'n'drop the archive into the GDM window. There are some very nice Gentoo themes available.

Finally, Xfce has its own built-in compositor to manage window transparency. This option can be found in Menu --> Settings --> Window Manager. For best performance, you will need to be running a graphics card with drivers that support hardware-accelerated rendering, and you will need to enable compositing in /etc/X11/xorg.conf by adding the following section:

Section "Extensions"
    Option  "Composite"  "Enable"
EndSection

This is the bare minimum configuration required for Xfce and Xorg-X11. However, setting up hardware-accelerated rendering depends on your individual graphics card, and is beyond the scope of this guide. Please see the other guides in the Desktop Documentation Resources list to learn about configuring hardware-accelerated rendering for your graphics card.

Summary

Congratulations on making it this far! You've installed and configured a speedy desktop environment with a solid suite of applications for your computing needs.

Resources

Need additional help on configuring and using Xfce? Need more lightweight application suggestions? Try asking the folks in:

  • The Gentoo forums
  • #xfce on irc.freenode.net

Finally, Gentoo's Xfce team is responsible for making Xfce available in Portage. Send comments, thanks, and suggestions to xfce@gentoo.org.