Skip to content

X11 and Wayland

dnaidoo621 edited this page May 30, 2026 · 1 revision

X11 and Wayland

Glide supports both display servers. The backend is selected automatically at startup by reading $XDG_SESSION_TYPE. No reinstall or configuration is needed when you switch.


Feature comparison

Feature X11 (pynput) Wayland (evdev / uinput)
Mouse movement
Left / right / middle click
Scroll
Media keys ✅ XF86 keysyms ✅ Linux keycodes
Arrow keys / Enter / Esc
Fullscreen (F11)
Text input (type_text) ✅ pynput direct ✅ wtype → ydotool → clipboard
Brightness control via xdotool / brightnessctl via brightnessctl
Extra system setup None /dev/uinput write permission

X11 backend

Uses pynput, which talks directly to the X server via Xlib. Media keys are sent as XF86 keysyms — standard keys that all X11 desktops understand.

No extra setup needed. If pynput can't connect to the X server, check that DISPLAY is set in the service environment:

systemctl --user show-environment | grep DISPLAY
# Should show: DISPLAY=:0  (or :1, etc.)

If it's missing:

systemctl --user set-environment DISPLAY=:0
systemctl --user restart htpc-remote

Wayland backend

Uses evdev / python-evdev to create a virtual input device via /dev/uinput. The kernel sees it as real hardware — it works with any Wayland compositor without compositor-specific APIs.

uinput permission

The installer adds a udev rule:

KERNEL=="uinput", GROUP="input", MODE="0660"

And adds your user to the input group:

sudo usermod -aG input $USER

You must log out and back in for the group change to take effect. Verify with:

groups $USER   # should include 'input'
ls -l /dev/uinput   # should show group = input

Text input on Wayland

Wayland compositors don't allow arbitrary key injection the same way X11 does. Glide tries these methods in order:

  1. wtype — types text via the Wayland text-input protocol. Install: sudo apt install wtype
  2. ydotool — generic input tool, works on most compositors. Install: sudo apt install ydotool
  3. Clipboard paste fallback — copies text to clipboard via wl-copy then sends Ctrl+V. Works everywhere but pastes rather than types, which can behave differently in some fields.

For best results, install wtype:

sudo apt install wtype

Checking the active backend

journalctl --user -u htpc-remote -b | grep -i "backend\|session\|wayland\|x11" | head -10

Forcing a specific backend

Set XDG_SESSION_TYPE in a service drop-in:

systemctl --user edit htpc-remote
[Service]
Environment=XDG_SESSION_TYPE=wayland

This is rarely needed — the auto-detection reads the value from your login session.

Clone this wiki locally