After watching a talk about the Hikari window manager, I was slightly horrified by how Wayland have been released since 10 years and still X11 is everywhere. So I decided to try it and see why.
The summary is: if you use Gnome (maybe also KDE through KWin?), Wayland may be usable for the average user. On the other hand, if you use a more niche window manager, it will be more fun :-)
This said, a lot of X11 applications will work under Wayland because of some magic provided by Xwayland, an X11 client that forwards all Wayland events to X11 seamlessy; in the end this means that you can stay on a mixed X11/Wayland desktop and migrate at your own pace (or - more likely - at the pace of development of applications you need to support Wayland).
So, on a recent Ubuntu 19.x, I simply had to logout and login again using Gnome/Wayland. Done. Enjoy Wayland and find what's not working.
If you use another window manager, read on, here be dragons.
§ Installing Sway
Under X I use i3 window manager, so the obvious choice was to install the Sway window manager which provides almost full compatibility with i3 config files (in my case just small adjustements). I've immediately noticed an annoying name clash with a Microsoft product, so search results are always a bit dirty. I am confident that the window manager will outlive the Microsoft product, so I'll just wait :-)
Sway is a project run by a fistful of heroes, they wrote their own Wayland compositor (wlroots) and other "utilities" like a wallpaper manager and all kind of ancillary stuff that you don't even see, but it's there and need constant maintenaince.
Sway has some rough edges but the project is incredibily active (I'll get to this in a bit) and the maintainers are quick to give feedback. These guys definitively need to be supported (I did).
So, the basic Sway configuration works fine, the fun starts when you need to customize and add features.
Some sparse tips:
To see if an application is running under XWayland, use
xeyesand hover over the application. If the eyes follow your cursor, that's a X11 application running through Xwayland.
Add these env variables for toolkits and applications to make them run on Wayland:
GDK_BACKEND=wayland(but not on Firefox)
Setting these variables seems to make Firefox and Thunderbird less stable and prone to crashes (TODO: investigate).
Check if we are running Wayland
$ echo $XDG_SESSION_TYPE wayland
§ Getting to the edge
Sway is a project run by a small number of volunteers, the main focus is the Arch Linux distribution (btw); this means that all the tools and components are packaged for other distributions (Debian, Ubuntu, etc.) by other volunteers. Given the pace of development of these tools, it's easy to run into issues because you have installed an "old" version of something ("old" being a couple of months before).
This is why I've decided to prepare a workflow to compile myself everything from the latest git stable tags. It's a work in progress and since I don't want to pollute my workstation with a lot of development packages, I'm experimenting with a Docker container and the OpenSUSE packaging service (there are already Sway build there that I can probably use as guidance). I will update this article when I'll have figured something.
If you are reading this and have suggestions, please let me know ;-)
UPDATE: I kind of found my way through a Docker container solution. Read here for more info. Using the build service from openSUSE is still not understood.
Besides rewriting parts of my i3 scripts to adjust them for Wayland, I'd like to replace my current X11 applications and utilities with "native" ones to see how far I can go. Here's a list I will keep updated:
mpv: works fine
- Firefox/Thunderbird: the porting to Wayland is in progress, there are some rough edges. Can be used under Xwayland. Or pure Wayland setting
MOZ_ENABLE_WAYLAND=1. There is a
firefox-waylandpackage but reports do not indicate to work very well. Tracking issue.
py3status(a better status bar for i3): swaybar
- Gnome application Wayland support
blueman-amanager: supports Wayland
nm-applet: supports Wayland (but broken: workaround is to force X11 backend, e.g.
GDK_BACKEND=X11 nm-applet --indicator)
UPDATE: fixed in v1.8.24
gnome-terminal: supports Wayland
- password-store uses
xclipto copy passwords in the clipboard. Wayland support has been merged but not yet released (as of January 2020). Need to check out the master branch. Install with
PREFIX=~/.local make install.
§ Open issues
Cannot copy and paste anymore to and from Emacs: the issue is with theSOLVED by updating to
xclip.elpackage, it does not use correctly wl-clipboard. Opened a bug report.
SOLVED by updating to
wl-clipboardshows weird visual artifacts, (also reflects when using in Emacs with
Firefox: sporadic UI blocks
screen lock (on lid close) sometimes doesn't work (screen is not locked before sleep mode)
Sometimes the WiFi network is disconnected
Sway sporadic crashes (esp. when reloading the configuration) and I am taken to the login.
TODO: investigate these errors (if related):
Jan 16 08:33:02 localhost xdg-desktop-por: Failed to get application states: GDBus.Error:org.freedesktop.portal.Error.Failed: Could not get window list: Cannot invoke method; proxy is for the well-known name org.gnome.Shell without an owner, and proxy was constructed with the G_DBUS_PROXY_FLAGS_DO_NOT_AUTO_START flag Jan 31 13:21:25 localhost xdg-desktop-por: Failed to get application states: GDBus.Error:org.freedesktop.portal.Error.Failed: Could not get window list: Cannot invoke method; proxy is for the well-known name org.gnome.Shell without an owner, and proxy was constructed with the G_DBUS_PROXY_FLAGS_DO_NOT_AUTO_START flag
gnome-terminalcannot open web links (from the "Open Link" shortcut), sometimes crashes when I try too hard :-)
Jan 24 13:17:47 localhost gnome-terminal-server: Error: no DISPLAY environment variable specified
DBus notifications daemon (
dunst) block Thunderbird for some seconds until all mailbox have been checked. Possibly other applications, too.
Feb 20 10:37:21 valkyrie systemd: Starting Dunst notification daemon... Feb 20 10:37:21 valkyrie dunst: CRITICAL: Cannot open X11 display. Feb 20 10:37:21 valkyrie systemd: dunst.service: Main process exited, code=exited, status=1/FAILURE Feb 20 10:37:21 valkyrie systemd: dunst.service: Failed with result 'exit-code'.
Tried to manually run
dunst -verbosity debugand notifications seem to work.
Polkit manager does not start or is broken. This is reflected in subtle errors on running stuff that require root permissions and just breaks, example Installing Virtualbox extension pack:
VBoxManage extpack install Oracle_VM_VirtualBox_Extension_Pack-4.1.8-75467.vbox-extpack