Using Wayland

From DcSharedWiki
Revision as of 06:03, 30 September 2019 by Duck (talk | contribs) (→‎Input Method)

Introduction

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 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

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 (updated for 1.2):

  • 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:

Way Cooler (spiritual successor of AwesomeWM)

Status: being rewritten on top of wlroots, far from being usable yet (as of early 2019)

Tools

Display Manager

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

Application Menu Runner

  • 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

  • mako:
    • not packaged in Debian
    • works fine
  • xfce4-notifyd:
    • 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
    • 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

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

Browser

Workarounds

GTK Applications

GTK uses GDK to draw and support for Wayland exists but a few things are missing thus it is not enabled by default. Currently you have to set this variable to enable it:

export GDK_BACKEND=wayland

Java Applications

Set _JAVA_AWT_WM_NONREPARENTING=1 in your environment and menu and always on top issues (and maybe others) will be fixed.

Readings