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.

Additionally, this guide will show you how to upgrade
from version 4.2 to 4.4.

Next, add your regular user(s) to the plugdev, cdrom, cdrw,
and usb groups, so that they can take full advantage of hal and be
able to mount and use devices such as cameras, optical drives, and USB sticks.

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 ApplicationsPanel 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 shown when you right-click on the panel.

xfce4-mount gives you a handy method of mounting devices listed in
/etc/fstab just by clicking your mouse

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.

verve is a small command line embedded into the panel. It's quicker
than opening up another terminal when you want to run a command.

xfce4-mixer is a volume control. It works with both ALSA and OSS
sound applications.

If you can't find what you're looking for in the plugins specifically made for
Xfce, try searching through the list of Gnome panel applets! That's right, by
first emerging xfce4-xfapplet, you can install and run any applet made
for Gnome.

Useful programs

Xfce bundles a few useful applications, including thunar,
terminal, orage, and mousepad. Note that the last three
will not be installed if you built xfce4 with the minimal USE
flag. However, these are all very small, yet terrific applications, so they're
well worth installing.

orage is a simple, handy calendar. mousepad is a barebones text
editor that starts up extremely quickly. 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. Just make sure that the default action on the
terminal launcher of your panel runs /usr/bin/Terminal instead of
xterm. Right click the launcher and choose "Properties" to change the command.

thunar is Xfce's built-in graphical file manager. It's fast yet quite
powerful, can support a few plugins for even more functionality; just install
them with emerge. Let's take a look:

thunar-archive lets you create and extract archive files using the
right-click menu. It works even better when paired with the new graphical
archiving tool
developed for Xfce, xarchiver.

thunar-media-tags lets you intelligently rename multiple media files
at once, and lets you edit
their information tags, such as id3 tags.

thunar-thumbnailers lets you preview
certain types of files from within Thunar, such as images and fonts.

thunar-volman automatically manages
removable media and drives.

Next, let's see about adding some useful but lightweight desktop applications,
in keeping with Xfce's philosophy.

Though mousepad is nice enough, 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 emerging claws-mail.

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 pidgin.

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.

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 is speedy and lightweight, but it isn't pretty, and isn't really
customizable. If you'd like to use it, first emerge it:

# emerge -avt xdm

Then edit the DISPLAYMANAGER variable in /etc/conf.d/xdm:

DISPLAYMANAGER="xdm"

xdm can automatically start your Xfce session if you add XSESSION="Xfce4"
to /etc/rc.conf.

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/; use these directories when you want all users
to be able to access themes and icon sets. Individual users can install themes
and icon sets to ~/.themes/ and ~/.icons/.

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. Make sure you emerged xfwm4 with
the xcomposite USE flag. Next, 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.

UpgradingUpgrading from 4.2 to 4.4

Upgrading from Xfce 4.2 to 4.4 isn't hard, but neither is it as simple as most
upgrades. With the release of 4.4, many older packages are either deprecated, or
their functionality has been included into the desktop in some other manner.

You'll notice that there will be a list of packages that block upgrading, as
most 4.2 packages cannot coexist with 4.4 packages. Here, the solution is pretty
straightforward: just unmerge the blocking packages, as described in the Portage
Handbook and man emerge, then continue with the update.

Next, you may need to rebuild certain packages, such as applications linked
against dbus. You'll need to first install gentoolkit for this.
Then, once gentoolkit is installed, run:

# revdep-rebuild -p(If you see any output about broken packages, run this next command)
# revdep-rebuild

Once the rebuild has finished, run revdep-rebuild -p again, just to make
sure you have a clean and consistent world. If anything still shows up, keep
repeating revdep-rebuild -p and revdep-rebuild until there's no
more output about broken packages. Most Xfce update problems stem from
dbus issues, as Xfce uses dbus quite extensively.

Next, restart dbus and/or hal.

# /etc/init.d/dbus restart
# /etc/init.d/hald restart

Finally, give yourself a fresh environment.

# env-update && source /etc/profile

Settings

Make sure you familiarize yourself with all the new options available in the new
Settings Manager. Of interest are the options in the Desktop screen; Xfce can
now manage your desktop and place icons on it.

There's also a Window Manager Tweaks screen, in which you can adjust the
behavior of windows, workspaces, and transparency (if enabled). Xfce 4.4 has
slightly changed the default behavior of workspaces and active window focus. If
you find that clicking a hyperlink in one workspace switches your browser to
that workspace from another one (or similar annoying window focus behavior), try
Settings --> Window Manager Tweaks --> Focus --> Activate Focus Stealing
Prevention.

Be sure to read the Xfce
Documentation and take the Xfce
Tour to learn more about 4.4 and how to configure it.

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 checking out:

The Gentoo forums

#xfce on irc.freenode.net

The installed help files and other documentation provided by Xfce:
/usr/share/xfce4/doc/C/index.html. Just point your browser at
it and start reading. There are even a lot of "hidden" configuration options
detailed in the help files.