After having installed Raspberry Pi OS Trixie on a Pi 500+ I wondered if XFCE would run with the default Wayland setup. I’m going to use the 500+ as a desktop solution so it would be nice if it would run my go-to desktop manager without having to switch to X11. Turns out Trixie comes with XFCE 4.20 that has partial Wayland support. So installed it and configured it to run as the default desktop environment. This blog post describes the steps I had to go through to get XFCE running with Wayland.
LightDM
The default login manager of the Raspberry Pi OS is LightDM so in order to be able to log into an XFCE session some changes need to be made there. By installing XFCE a Wayland session desktop file gets installed too and by referencing this file in the LightDM configuration you can have LightDM starting up an XFCE session after a successful login. The involved entries are user-session and autologin-session under the [Seat:*] section. These default to rpd-labwc. Change the values of these entries to xfce-wayland and after having restarted LightDM you should log into an XFCE session. So your /etc/lightdm/lightdm.conf file should have the following entries:
[Seat:*]
...
user-session=xfce-wayland
autologin-session=xfce-wayland
...
Restarting LightDM can be done with sudo systemctl restart lightdm. Bear in mind this will log you out immediately!
XFCE
Within XFCE you can now customise the environment to your liking. I like the Greybird theme so I installed that and set it as the Style in the Appearance app. For the icons I prefer the elementary theme so after having installed that theme I selected it under the Icons tab. For the rest I’m OK with the defaults. After that I configured my panels. Setting the wallpaper and cursor theme with the XFCE tools doesn’t work though so I had to resort to setting those using the swaybg utility and the labwc window manager.
labwc
To set the wallpaper/background I installed the swaybg package and created the file wallpaper.desktop in ~/.config/autostart/ with the following content:
[Desktop Entry]
Type=Application
Version=1.0
Name=Set Wallpaper
Comment=Set Wallpaper
Exec=swaybg -i /usr/share/rpd-wallpaper/RPiSystem_dark.png -m fill
Terminal=false
You can change /usr/share/rpd-wallpaper/RPiSystem_dark.png to the path of he wallpaper of your choice. This will get picked up on your next login. Next up, the cursor theme. I prefer the DMZ-White theme and you can set this using labwc. labwc looks into ~/.config/xfce4/labwc/ for its configuration after having installed XFCE so I modified the environment file in that directory to look like this:
# Mouse settings
XCURSOR_THEME=DMZ-White
I also added a section to disable Caps Lock and map the right Alt key to the Compose key:
# Keyboard settings
XKB_DEFAULT_LAYOUT=
XKB_DEFAULT_OPTIONS=compose:ralt,ctrl:nocaps
I did some more personal customisation in ~/.config/xfce4/labwc/rc.xml, like changing and adding some key bindings and changing some theme settings. Having worked with Openbox for years (https://autostatic.com/tag/openbox/) this felt very familiar.
One thing was still missing and that was the network icon in my top panel. So I installed the network-manager-applet package and added the file nm-applet.desktop to the ~/.config/autostart/ directory with the following content:
[Desktop Entry]
Type=Application
Version=1.0
Name=nm-applet
Comment=Start NetworkManager taskbar applet
Exec=/usr/bin/nm-applet
Terminal=false
Loose ends
There must be a way to set the wallpaper right after login. Now it takes over 5 seconds before swaybg sets the wallpaper. Also intelligently hiding an XFCE panel only seems to work with maximised windows. So I’ve set “Automatically hide the panel” to “Always” for the bottom panel. xfce4-screenshooter can only take screenshots of the whole desktop, not of single windows. Another thing is the Raspberry Pi Control Center (rpcc), once I ran that it set some defaults, breaking some changes I had made.
References
I used to following sources to gather information:
- As a starting point I used https://github.com/crispinprojects/xfce4-wayland
- To find out how to change the cursor theme I dug through https://github.com/J3sven/wayland-cursor-theme-utility/blob/main/cursor-utility.sh and realised I should try removing the double quotes around the theme name. That did the trick.
- https://labwc.github.io/ for various labwc related stuff
- XFCE – Wayland roadmap: https://wiki.xfce.org/releng/wayland_roadmap