Using Wayland: Difference between revisions

From DcSharedWiki
(10 intermediate revisions by the same user not shown)
Line 3: Line 3:
The goal of this page is to relate experiences using Wayland working implementations, software replacement from the X11 world and so on.
The goal of this page is to relate experiences using Wayland working implementations, software replacement from the X11 world and so on.


Duck: also please note I'm an AwesomeWM user so I'm not looking into major desktop implementations like GNOME or KDE but more on mixing interesting pieces to fit your needs better. You can have a look at my configuration [https://vcs-git-viewer.duckcorp.org/?p=people/duck/duckland-infra.git;a=tree in my repository] (Ansible rules).
Duck: please note I'm a former AwesomeWM user thus I'm not looking into major desktop implementations like GNOME or KDE but I'm trying to mix interesting pieces to fit my needs better. You can have a look at my configuration [https://vcs-git-viewer.duckcorp.org/?p=people/duck/duckland-infra.git;a=tree in my repository] (Ansible rules).


== Compositors ==
== Compositors ==
Line 12: Line 12:


=== [https://swaywm.org/ Sway] ===
=== [https://swaywm.org/ Sway] ===
(updated for 1.4)


Status: very active project, created a wlroots framework to share with other compositors, version 1.1 is usable with some glitches, seamless xwayland integration
Status: very active project, created a wlroots framework to share with other compositors, version 1.1+ is usable with some glitches, seamless xwayland integration


Packaging: in Debian with wlroots and swaybg
Packaging: in Debian with wlroots and swaybg


Notable problems (updated for 1.2):
Notable problems:
* [https://github.com/swaywm/sway/issues/3395 damage tracking issues with xwayland] (ugly but not not annoying with most applications)
* [https://github.com/swaywm/sway/issues/3395 damage tracking issues with xwayland] (ugly but not not annoying with most applications)
* contextual windows in need of relative positioning are not displayed or not at the right location (tray contextual menu, IM selections)
* contextual windows in need of relative positioning are not displayed or not at the right location (tray contextual menu, IM selections)
Line 29: Line 30:
** Status: works fine but [https://github.com/swaywm/sway/issues/3799 tray support is limited] (icon may be missing, contextual menu not working, WIP)
** Status: works fine but [https://github.com/swaywm/sway/issues/3799 tray support is limited] (icon may be missing, contextual menu not working, WIP)
* [https://github.com/Alexays/Waybar.git Waybar] (more fancy bar)
* [https://github.com/Alexays/Waybar.git Waybar] (more fancy bar)
** not packaged in Debian
** packaged in Debian
** Status: tested only a short time, tray working better than swaybar but contextual menu currently displayed in the middle of the screen, [https://github.com/Alexays/Waybar/issues/223 passing TZ to clock widget is not yet implemented]
** Status: tested only a short time, tray working better than swaybar but contextual menu currently displayed in the middle of the screen (should be fixed if built with gtk-layer-shell but disabled in Debian for some reason and manual build failed with this option)
* swaylock (lock screen)
* swaylock (lock screen)
** packaged in Debian
** packaged in Debian
Line 36: Line 37:
* swayidle (run custom actions on idle and back from idle)
* swayidle (run custom actions on idle and back from idle)
** packaged in Debian
** packaged in Debian
** Status: works fine and handle various events but [https://github.com/swaywm/swayidle/pull/26 does not implement the inhibit mode] (like while watching a movie)
** Status: works fine and handle various events
* remote desktop
* remote control (not network transparency)
** integrated with sway
** integrated in sway
** Status: finished, untested (RDP backend replaced, need to have a deeper look)
** Status: [https://github.com/swaywm/wlroots/pull/1578 wlroots support has been implement], [https://github.com/swaywm/sway/issues/2939 Sway now needs to make use of it]


=== [http://way-cooler.org/ Way Cooler] (spiritual successor of AwesomeWM) ===
=== [http://way-cooler.org/ Way Cooler] (spiritual successor of AwesomeWM) ===


Status: being rewritten on top of wlroots, far from being usable yet (as of early 2019)
Status: was being rewritten on top of wlroots but was [http://way-cooler.org/blog/2020/01/09/way-cooler-post-mortem.html unfortunately abandoned] at the beginning of 2020. I need some time to cope with the sadness and remove this entry.


== Tools ==
== Tools ==
Line 55: Line 56:
=== Application Menu Runner ===
=== Application Menu Runner ===


* wofi:
** packaged in Debian
** Status: works fine
** Usage: wofi --term=x-terminal-emulator
* j4-dmenu-desktop + [https://github.com/Cloudef/bemenu.git bemenu]:
* j4-dmenu-desktop + [https://github.com/Cloudef/bemenu.git bemenu]:
** j4-dmenu-desktop only is packaged in Debian
** j4-dmenu-desktop only is packaged in Debian
Line 64: Line 69:
** Usage: dmenu_path | dmenu -p "Run:" -l 10 | xargs swaymsg exec
** Usage: dmenu_path | dmenu -p "Run:" -l 10 | xargs swaymsg exec


=== Notifications ===
=== Notifications / Screen Overlay ===


* [https://github.com/emersion/mako.git mako]:
* [https://github.com/emersion/mako.git mako] (notifications):
** not packaged in Debian
** packaged in Debian (mako-notifier)
** works fine
** works fine
* wob (progressbar)
* xfce4-notifyd:
** packaged in Debian
** Status: works fine
* xfce4-notifyd (notifications):
** packaged in Debian
** packaged in Debian
** Status: works fine but display in the middle of the screen thus not very practical
** Status: works fine but display in the middle of the screen thus not very practical
Line 77: Line 85:
* fcitx4:
* fcitx4:
** packaged in Debian
** packaged in Debian
** Status: untouched config from X11 works but completion menu may not be displayed (it works on one machine and not another but I could not figure out why yet); running ''fcitx-autostart'' fixed it
** Status: untouched config from X11 works but completion menu may not be displayed (it works on one machine and not another but I could not figure out why yet); running ''fcitx-autostart'' fixed it (you may need to ``killall fcitx`` first)
* fcitx5:
* fcitx5:
** has Wayland support
** has Wayland support
Line 95: Line 103:
* termite: (native Wayland support)
* termite: (native Wayland support)
** not packaged in Debian and requires a patched libvte
** not packaged in Debian and requires a patched libvte
** works fine
** Status: works fine
* xfce4-terminal:
* xfce4-terminal:
** packaged in Debian
** packaged in Debian
Line 111: Line 119:
=== Screen Brightness ===
=== Screen Brightness ===


* light:
** packaged in Debian
** Status: works fine
* brightnessctl:
* brightnessctl:
** packaged in Debian (brightness-udev is needed to be usable as non-root)
** packaged in Debian (brightness-udev is needed to be usable as non-root)
Line 123: Line 134:
** packaged in Debian
** packaged in Debian
** Status: works fine on XWayland, [https://bugs.chromium.org/p/chromium/issues/detail?id=578890 native Wayland support is WIP]
** Status: works fine on XWayland, [https://bugs.chromium.org/p/chromium/issues/detail?id=578890 native Wayland support is WIP]

=== Misc ===

* [https://github.com/Blub/netevent netevent] (Input-Event device cloning utility)
** use case: if you wish to control several machines with the same keyboard and mouse, like with a KVM switch, then you can use devices from one to control others and switch machine using a special key
** not packaged in Debian but materials provided upstream (needs [https://github.com/Blub/netevent/pull/15 this update though])
** Status: works fine


== Workarounds ==
== Workarounds ==


=== GTK Applications ===
=== GUI Frameworks ===


GTK uses GDK to draw and support for Wayland exists but [https://wiki.gnome.org/Initiatives/Wayland/GTK%2B a few things are missing] thus it is not enabled by default. Currently you have to set this variable to enable it:
GTK uses GDK to draw and support for Wayland exists but [https://wiki.gnome.org/Initiatives/Wayland/GTK%2B a few things are missing] thus it is not enabled by default. Other frameworks do not always enable Wayland by default depending on distro and version.


Currently this works fine (in ''~/.xsessionrc''):
export GDK_BACKEND=wayland
# ensure GUI frameworks use Wayland
#export GDK_BACKEND=wayland # breaks a few apps or behaviors (Firefox, Signal…)
export CLUTTER_BACKEND=wayland
export QT_QPA_PLATFORM=wayland-egl
export SDL_VIDEODRIVER=wayland


=== Java Applications ===
=== Java Applications ===


Set ''_JAVA_AWT_WM_NONREPARENTING=1'' in your environment and menu and always on top issues (and maybe others) will be fixed.
Set ''_JAVA_AWT_WM_NONREPARENTING=1'' in your environment (in ''~/.xsessionrc'') to fix behavior with menus and ''always on top'' issues (and maybe others).


== Readings ==
== Readings ==

Revision as of 07:17, 28 April 2020

Introduction

The goal of this page is to relate experiences using Wayland working implementations, software replacement from the X11 world and so on.

Duck: please note I'm a former AwesomeWM user thus I'm not looking into major desktop implementations like GNOME or KDE but I'm trying to mix interesting pieces to fit my needs better. You can have a look at my configuration in my repository (Ansible rules).

Compositors

There's many Wayland compositor projects around but a lot are very experimental and many even already abandoned.

Working or prospective compositors follows.

Sway

(updated for 1.4)

Status: very active project, created a wlroots framework to share with other compositors, version 1.1+ is usable with some glitches, seamless xwayland integration

Packaging: in Debian with wlroots and swaybg

Notable problems:

  • damage tracking issues with xwayland (ugly but not not annoying with most applications)
  • contextual windows in need of relative positioning are not displayed or not at the right location (tray contextual menu, IM selections)
  • games under Wine may not draw or grab input correctly if run fullscreen (but windowed using the full screen size is fine and anyway often better especially with older games when you switch back and forth between workspaces)
  • rendering issues (most glitches do not have any real impact)
  • dialogs hidden under their parent (annoying with specific applications relying on child windows but most don't and there is a workaround)

Tools:

  • swaybar (display workspaces, current window title, tray, time, CPU infos…)
    • integrated with sway, can use various commands to display stuff (i3status works fine and is packaged in Debian)
    • Status: works fine but tray support is limited (icon may be missing, contextual menu not working, WIP)
  • Waybar (more fancy bar)
    • packaged in Debian
    • Status: tested only a short time, tray working better than swaybar but contextual menu currently displayed in the middle of the screen (should be fixed if built with gtk-layer-shell but disabled in Debian for some reason and manual build failed with this option)
  • swaylock (lock screen)
    • packaged in Debian
    • Status: works fine
  • swayidle (run custom actions on idle and back from idle)
    • packaged in Debian
    • Status: works fine and handle various events
  • remote control (not network transparency)
    • integrated in sway
    • Status: finished, untested (RDP backend replaced, need to have a deeper look)

Way Cooler (spiritual successor of AwesomeWM)

Status: was being rewritten on top of wlroots but was unfortunately abandoned at the beginning of 2020. I need some time to cope with the sadness and remove this entry.

Tools

Display Manager

  • lightdm:
    • packaged in Debian
    • Status: works fine to run Wayland sessions but runs on X11 itself

Application Menu Runner

  • wofi:
    • packaged in Debian
    • Status: works fine
    • Usage: wofi --term=x-terminal-emulator
  • j4-dmenu-desktop + bemenu:
    • j4-dmenu-desktop only is packaged in Debian
    • Status: works fine
    • Usage: j4-dmenu-desktop --dmenu='bemenu --list 10 --wrap --ignorecase --no-overlap --prompt "Run:" --fn "pango:DejaVu Sans Mono 12"' --term=x-terminal-emulator
  • dmenu:
    • packaged in Debian (suckless-tools)
    • Status: works fine but impossible to switch back to it if you loose focus (need to kill it in a term)
    • Usage: dmenu_path | dmenu -p "Run:" -l 10 | xargs swaymsg exec

Notifications / Screen Overlay

  • mako (notifications):
    • packaged in Debian (mako-notifier)
    • works fine
  • wob (progressbar)
    • packaged in Debian
    • Status: works fine
  • xfce4-notifyd (notifications):
    • packaged in Debian
    • Status: works fine but display in the middle of the screen thus not very practical

Input Method

  • fcitx4:
    • packaged in Debian
    • Status: untouched config from X11 works but completion menu may not be displayed (it works on one machine and not another but I could not figure out why yet); running fcitx-autostart fixed it (you may need to ``killall fcitx`` first)
  • fcitx5:
    • has Wayland support
    • only the core is packaged in Debian
    • Status: i was not able to make it work and quit
  • ibus:
    • packaged in Debian
    • Status: ibus-wayland is available and was switched to using a newer version of the wayland input protocol (see Debian#905001 and linked upstream BR) but Sway use an even newer version (and this one only); anyway these changes are mostly untested so I would not have too much hopes; without this plugin I was not able to make completion work at all, even when forcing the engine on the command-line

So here are the various protocols:

Terminal

  • termite: (native Wayland support)
    • not packaged in Debian and requires a patched libvte
    • Status: works fine
  • xfce4-terminal:
    • packaged in Debian
    • Status: works fine
  • terminator:
    • packaged in Debian
    • Status: works fine (with Sway >=1.1)

Screen Capture

  • grim: (screenshot)
    • packaged in Debian
    • Status: works fine

Screen Brightness

  • light:
    • packaged in Debian
    • Status: works fine
  • brightnessctl:
    • packaged in Debian (brightness-udev is needed to be usable as non-root)
    • Status: works fine

Browser

Misc

  • netevent (Input-Event device cloning utility)
    • use case: if you wish to control several machines with the same keyboard and mouse, like with a KVM switch, then you can use devices from one to control others and switch machine using a special key
    • not packaged in Debian but materials provided upstream (needs this update though)
    • Status: works fine

Workarounds

GUI Frameworks

GTK uses GDK to draw and support for Wayland exists but a few things are missing thus it is not enabled by default. Other frameworks do not always enable Wayland by default depending on distro and version.

Currently this works fine (in ~/.xsessionrc):

# ensure GUI frameworks use Wayland
#export GDK_BACKEND=wayland   # breaks a few apps or behaviors (Firefox, Signal…)
export CLUTTER_BACKEND=wayland
export QT_QPA_PLATFORM=wayland-egl
export SDL_VIDEODRIVER=wayland

Java Applications

Set _JAVA_AWT_WM_NONREPARENTING=1 in your environment (in ~/.xsessionrc) to fix behavior with menus and always on top issues (and maybe others).

Readings