This post is part of a series on Xfce, originally posted on my university blog. I’m republishing them here in the hopes that others might find them useful or interesting. Cheers!

In my Fun with Xfce part one post I explained that I find Xfce such a pleasure to use because it's fast, lightweight and has natural visually consistency with my GTK+ apps without the bloat of GNOME, while still providing a cohesive desktop experience with functional applications. In this post I'll be explaining how to install it.

ASIDE: If you want to give Xfce a try without going through the process of using a package manager and configuring Xorg, the Zenwalk and Xubuntu GNU/Linux distributions have Xfce as their default desktops, plus they have very slick installers and are very newbie friendly.

What's so liberating about using Xfce as opposed to GNOME or KDE is how lightweight it is and how few dependencies it has in comparison. This is especially noticeable on computers with less storage space, and slower machines which can literally take an entire day to build a desktop environment from source, if that's your preferred installation method. Of course this means that Xfce is missing some features, but I don't find myself missing any of them.

Xfce About dialog box, Terminal window showing FreeBSD uname

My experience with package managers are really limited to the FreeBSD ports system and NetBSD's pkgsrc (on NetBSD and Slackware Linux), so these will be the systems I'll talk about here. Most *nix package management systems have Xfce though, and most have an easy to install "meta" package that contains the whole desktop.

To install a complete Xfce desktop on FreeBSD (I'm assuming you already have X installed and configured), update your ports tree (visit the Using the Ports System chapter in the FreeBSD handbook if you need help) then compile and install. Alternatively you can install the pre-compiled package which is generally up to date with Xfce's releases (currently at 4.4.2).

For FreeBSD ports:

# cd /usr/ports/x11-wm/xfce4
# make install clean

Or the FreeBSD metapackage:

# pkg_add -rv xfce4

With NetBSD’s pkgsrc, the procedure is just as easy:

# cd /usr/ports/meta-pkgs/xfce4
# make install clean clean-depends

Then it's simply a matter of adding exec startxfce4 to your .xinitrc file in your home directory; create it from scratch if it doesn't exist. Make sure to comment out any other lines related to other desktops and/or window managers you might have installed (but obviously keep lines you may have added to have X11 applications start automatically when you launch X).

Typing startx at this point will start X and your new Xfce desktop!

ASIDE: If you haven’t aliased your machine’s hostname to in your /etc/hosts file, Xfce will give you a warning message. You can safely ignore it, but it can get irritating after a while! Edit your host file to fix this.

In the next post I'll be explaining how I pretty up Xfce by adding new themes and icon sets, and how to make it look like other desktops. Stay tuned.