hongy19’s blog
Wayland and weston
- Wayland
- see overview: Wayland Weston overview
- Wayland is a communication protocol that specifies the communication between a display server and its clients, from wikipedia
- Weston is the reference implementation of a Wayland compositor, from weston github.
- Weston
- backends, from “man weston”
- drm-backend.so: The DRM backend uses Linux KMS for output and evdev devices for input
- wayland-backend.so: The Wayland backend runs on another Wayland server, a different Weston instance
- x11-backend.so: The X11 backend runs on an X server
- rdp-backend.so: The RDP backend runs in memory without the need of graphical hardware.
- to run weston from wsl2, use wayland-backend.so.
- to run weston for rdp connection, use rdp-backend.so
- all for drm connector, see “/sys/class/drm”
- modules/shell
- all *.so are located at usr/lib/weston for modules and shell in weston.ini
- weston terminal
- scale: scale text for high DPI screen
- GDK setting for GTK application from application level
- export GDK_BACKEND=wayland
- #To scale UI elements by an integer only factor
- #GTK3/4 does not support fractional scaling currently, so fractional factors will be ignored
- export GDK_SCALE=1
- #GDK_DPI_SCALE can be used to scale text only
- export GDK_DPI_SCALE=1.2
- composition level
- “[output]” on weston.ini, only work for drm and X11. set “scale=1.5”.
font, 2D drawing on linux
Here come several basic concept for font, drawing on linux
- DRM/KMS
- DRM/KMS is used to connect/control physical display. It will convert pixel from memory and send it to display connector. It means if you rendering your desktop remotely( X11 forwarding, RDP), you don’t need DRM/KMS.
- DRM KMS overview
- The DRM/KMS subsystem from a newbie’s point of view
- see “/sys/class/drm” for physical connector.
- font
- Anti-aliasing and subpixel rendering, see “A Closer Look At Font Rendering” for concept introduction.
- black and white rendering is first generation rendering and print still use it.
- gray-scale rending (anti-aliasing) is second generation rendering to utilize controlling the brightness of each pixel.
- subpixel (ClearType in windows) is third generation rendering to utilize controlling pixel colors. it is for LCD on which screens, the red, green and blue subpixels that control the color and brightness of the pixel.
- Archlinux enable Anti-aliasing and subpixel by default.
- font configuration on Archlinux wiki introduce default configuration for Archlinux.
- fontconfig/freetype/pango
- Very good overview introduction: Modern text rendering with Linux: Overview
- Text Rendering Notes
- Font basic concept introduction, see CSS Fonts Module Level 3
remote desktop on linux
- X11 forwarding, see my blog.
- RDP
- xrdp
- this one seems only work for Xwindows, not wayland.
- Wayland
- Not all wayland application support RDP, some only support VNC.
- sway doesn’t support rdp but only vnc, see link.
- weston, see link
- On the target linux device, install freerdp and weston
- pacman -S freerdp
- pacman -S weston
- On the target linux device, generate RDP certificates
- sudo mkdir -p /etc/freerdp/keys/
- sudo winpr-makecert -rdp -path /etc/freerdp/keys/
- On the target linux device, start weston
- weston –backend=rdp-backend.so –rdp-tls-cert=/etc/freerdp/keys/server.crt –rdp-tls-key=/etc/freerdp/keys/server.key
- On the windows side, start “Remote Desktop Connection” and fill in targe linux server ip.
- waypipe, see link.
- installed waypipe on both the local and remote computers
- yay -Y waypipe
- run waypipe on local linux/wsl
- waypipe ssh user@theserver weston-terminal



