Testing xfce components on Wayland

A few weeks ago I was looking for a lightweight terminal emulator to that works on Wayland and was easy to install in a VM. I found that xfce4-terminal fit that need and used it in a blogpost:

This led me to wonder about other elements of xfce and how well they would work with Mir. It has taken a while to get around to it but I’ve set up a test environment to try them and the answer is “pretty well”:

As in the above blogpost, I set up a VM using Multipass with the following script which also available from github (https://github.com/AlanGriffiths/multipass-utils/blob/master/xfce-wayland).

set -euo pipefail

vm_name="${1:-$(basename "$0")}"

until command -v multipass > /dev/null
  echo "Multipass is not installed, do you wish to install it?"
  select install in "Yes" "No"; do
    case $install in
        Yes ) sudo snap install multipass; break;;
	No ) break;;

if ! multipass start "${vm_name}"
  set -x
  multipass launch -v -n "${vm_name}" --cloud-init - <<EOF
    - $(cat ~/.ssh/id_rsa.pub)
    - fonts-freefont-ttf
    - fonts-font-awesome
    - xfce4-terminal
    - xfce4-goodies
    - xfdesktop4-data
    - sudo snap install --classic --channel=edge egmde
  multipass exec "${vm_name}" -- sh -c "mkdir --parents ~/.config"
  multipass exec "${vm_name}" -- sh -c "if ! grep -q no-of-workspaces= ~/.config/egmde.config; then echo no-of-workspaces=4 >> .config/egmde.config; fi"
  multipass exec "${vm_name}" -- sh -c "if ! grep -q enable-autostart= ~/.config/egmde.config; then echo enable-autostart=  >> .config/egmde.config; fi"
  multipass exec "${vm_name}" -- sh -c "if ! grep -q swaybg.image= ~/.config/egmde.config; then echo swaybg.image=/usr/share/backgrounds/xfce/xfce-stripes.png  >> .config/egmde.config; fi"
  set +x

host_ip=$(multipass info "${vm_name}" --format csv | awk -F, '/^'"${vm_name}"'/ { print $3 }')
exec ssh -XC "ubuntu@${host_ip}" sh -lc egmde

Configuring egmde for Wayland only

By default, the egmde snap configures the system to support X11 applications but this isn’t always what is wanted. Sometimes one wants to see what works with only Wayland supported.

Setting up a VM with the above script doesn’t change the default, but you can do so by editing a configuration file and restarting egmde.

When the Mir-on-X window opens press Ctrl-Alt-A to get the launcher and then v to get “Vim” and press Enter. Then open .config/egmde.config for editing.

Then comment out the following:


Save, exit Vim and exit egmde with Ctrl-Alt-BkSp. Next time you run the script X11 support will be disabled.


I’ve tried a bit more experimenting. Firstly, I updated the script to launch the 21.04 pre-release (daily:hirsute in multipass speak) and added a few more xfce packages (xfce4-panel and xfdesktop).

Unfortunately these have dependencies on X11, so they don’t actually work with Mir’s default settings (telling GDK to useWayland) and I chose not to investigate further. That would require re-enabling X11 support and writing wrapper scripts for them to ensure they use it.

I also tried installing the xfce4 meta package and hacking all the autostart applications to run when egmde starts:

sudo apt install xfce4
mkdir .config/autostart/
cp `grep -l OnlyShowIn.*XFCE /etc/xdg/autostart/*` .config/autostart/
sed -i s/OnlyShowIn=XFCE/OnlyShowIn=egmde/ .config/autostart/*

Then restarting egmde tried starting these applications with mixed success:

[2021-04-21 14:41:47.056774] <information> egmde: autostarting: '/usr/share/xscreensaver/xscreensaver-wrapper.sh -no-splash'
[2021-04-21 14:41:47.064265] <information> egmde: autostarting: 'xfsettingsd'
[2021-04-21 14:41:47.065422] <information> egmde: autostarting: '/usr/lib/x86_64-linux-gnu/xfce4/notifyd/xfce4-notifyd'
[2021-04-21 14:41:47.065368] [2021-04-21 14:41:47.066590] <information> egmde: autostarting: 'xfce4-screensaver'
< -warning- > miral: Failed to execute client ("/usr/share/xscreensaver/xscreensaver-wrapper.sh") error: No such file or directory
[2021-04-21 14:41:47.068127] <information> egmde: autostarting: '/usr/libexec/gnome-shell-overrides-migration.sh'
[2021-04-21 14:41:47.072137] <information> egmde: autostarting: '/usr/libexec/geoclue-2.0/demos/agent'
[2021-04-21 14:41:47.090650] <information> egmde: autostarting: '/usr/libexec/evolution-data-server/evolution-alarm-notify'
[2021-04-21 14:41:47.117442] <information> egmde: autostarting: 'xiccd'
[2021-04-21 14:41:47.120616] <information> egmde: autostarting: 'start-pulseaudio-x11'
[2021-04-21 14:41:47.173859] <information> egmde: autostarting: 'sh -c 'if [ "x$XDG_SESSION_TYPE" = "xwayland" ] ; then exec env IM_CONFIG_CHECK_ENV=1 im-launch true; fi''
[2021-04-21 14:41:47.201923] <information> egmde: autostarting: 'xdg-user-dirs-update'
[2021-04-21 14:41:47.216567] <information> egmde: autostarting: '/usr/libexec/at-spi-bus-launcher --launch-immediately'

** (xiccd:9971): CRITICAL **: 14:41:47.246: Can't open display: 
[2021-04-21 14:41:47.253971] <information> egmde: autostarting: 'xfce4-power-manager'
[2021-04-21 14:41:47.288040] <information> egmde: autostarting: 'system-config-printer-applet'
[2021-04-21 14:41:47.321242] <information> egmde: autostarting: 'nm-applet'
[2021-04-21 14:41:47.352417] <information> egmde: autostarting: '/usr/bin/snap userd --autostart'

But although some of these programs ran this didn’t achieve anything usable. (Yet.)