A look at Xfce

Last edited on 2021-07-03 Tagged under  #xfce   #debian   #linux 

My Xfce

Xfce is a lightweight desktop environment that is an excellent alternative to GNOME and KDE.

Things I like:

  • usable out-of-box with sensible defaults
  • easy to configure and customize
  • modular components that can be swapped out for alternatives, or used in non-Xfce desktops

That last point is what led me to try Xfce in the first place. I've successfully used Xfce's power manager for years in Openbox. The great thing about Xfce is that, for a little extra overhead, you get all the flexibility of a window manager like Openbox plus all the added perks of a full desktop. Xfce can be configured to provide a comfortable migration path for new Linux users coming from Windows or Mac OS, or customized to the nth degree for longtime users.

Here are some things I do with Xfce (v4.16) running on (pre-release) Debian 11 Bullseye.

Packages

On a new machine, I like to start with a minimal install of Debian, then add Xfce afterwards.

A simple ...

$ sudo apt install task-xfce-desktop

... will pull in the complete bells-and-whistles desktop.

Plus a few desktop extras that I want ...

$ sudo apt install diodon fonts-firacode fonts-ubuntu lightdm-gtk-greeter papirus-icon-theme plymouth-themes qt5-style-plugins wmctrl xdotool  

Login, then go to Applications->Settings->Settings Manager to configure the desktop.

Startup applications

Add applications to run at startup in Applications->Settings->Session and Startup->Application Autostart.

I like to have a terminal immediately available after login, so I add the command xfce4-terminal --maximize to the list.

Another useful application to launch at startup is diodon (clipboard).

Keyboard shortcuts

Customize keyboard shortcuts for managing windows, simple tiling, applications, switching desktops, and whatnot in Settings->Keyboard and Settings->Window Manager->Keyboard.

At home I connect my laptop to an external monitor that I use as my primary display. Xfce doesn't have a keyboard shortcut for moving windows between the two displays, so I use this python script to provide that function, and set a command shortcut in Applications->Settings->Keyboard->Application Shortcuts.

Xfce-terminal binds F1 and F11 to help and fullscreen, respectively, which can make using terminal programs like htop difficult. To disable those shortcuts, edit ~/.config/xfce4/terminal/accels.scm ...

(gtk_accel_path "<Actions>/terminal-window/fullscreen" "")
(gtk_accel_path "<Actions>/terminal-window/contents" "")

Disable hidden scrollbars

Some (GTK) desktop windows have scrollbars that disappear when the mouse is not moving. If you want scrollbars to always remain visible, add the setting GTK_OVERLAY_SCROLLING=0 to /etc/environment.

Panelbar

Add, remove, arrange the components of the xfce-panel in Applications->Settings->Panel.

In addition, I set the tasklist buttons to expand into available space, and change the styling of other buttons, by creating the file ~/.config/gtk-3.0/gtk.css.

See: "Enlarge size of window button" and "Panelbar theming"

Appearance

Xfce is styled using themes, which can be installed in ~/.themes. Sometimes with dramatic results.

I like to style my desktop around the Nord colour palette ...

  • Download Nordic theme and install in ~/.themes.
  • Select Nordic in Applications->Settings->Appearance->Style.
  • Select Papirus-Dark icons in Applications->Settings->Appearance->Icons.
  • Download Nord-xfce-terminal and install nord.theme in ~/.local/share/xfce4/terminal/colorschemes.
  • Select Nord in terminal's Edit->Preferences->Colors->Load Presets....

I like Fira Code fonts for the terminal. Select Fira Code Regular in Edit->Preferences->Appearance-Font.

For a uniform look between GTK and QT applications, add to ~/.profile ...

export QT_QPA_PLATFORMTHEME=gtk2

LightDM

LightDM is a display manager + login greeter for desktops.

Select a background wallpaper and theme in /etc/lightdm/lightdm-gtk-greeter.conf ...

[greeter]
background=/usr/share/pixmaps/my_background_wallpaper.jpg
theme-name=Adwaita-dark

Set a user avatar by saving a 96x96 pixel image to ~/.face.

Both in /etc/lightdm/lightdm.conf and /usr/share/lightdm/lightdm.conf.d/01_debian.conf, set ...

greeter-hide-users=false

Restart ...

$ sudo systemctl restart lightdm.service

Since I already enter a passphrase at boot to unlock my LUKS-encrypted storage, I enable auto-login to skip the login screen.

Example: To enable auto-login for user foo, change these lines in /etc/lightdm/lightdm.conf from ...

[Seat:*]
#autologin-user=
#autologin-user-timeout=0

... to ...

[Seat:*]
autologin-user=foo
autologin-user-timeout=0

Xsessionrc

To source the contents of ~/.profile when using LightDM, create ~/.xsessionrc with the entry ...

. $HOME/.profile

Plymouth

Plymouth presents a graphical display while the system boots.

Modify /etc/default/grub to set the splash option, and the GRUB display resolution (example: 1366x768) ...

GRUB_CMDLINE_LINUX_DEFAULT="quiet splash"
GRUB_GFXMODE=1366x768

Save changes, and update GRUB ...

$ sudo update-grub

I like Circle from this Plymouth theme collection. To use this theme, download and unpack the collection, then ...

$ sudo cp -r /path/to/plymouth/theme/circle/ /usr/share/plymouth/themes
$ sudo plymouth-set-default-theme -R circle

Good stuff!

Thanks for reading! Read other posts?

» Next: Install the LTS kernel in Arch Linux

« Previous: Self-host a personal calendar and address book using Radicale