Yserver:一个用 Rust 编写的现代 X11 服务器
Yserver: A modern X11 server written in Rust

原始链接: https://github.com/joske/yserver

这是一个用 Rust 编写的现代化、从零构建的 X11 服务器,专为当代 Linux 环境设计。与 Xorg 不同,它有意去除了冗余的遗留负担(如间接 GLX、非真彩色视觉效果和过时的 DDX 驱动程序),从而提供了一种精简且实用的体验。 该服务器目前支持多种 X11 扩展(包括 DRI3、GLX 和 RENDER),能够运行 MATE、XFCE 和 Cinnamon 等完整的桌面环境,以及各种窗口管理器。它已在包括 AMD、Intel、Apple Silicon (Asahi) 和 Qualcomm 在内的多种硬件上成功通过测试,并利用 DRM/KMS 进行显示管理。请注意,它与专有 NVIDIA 驱动程序不兼容。 主要功能包括: * **广泛的兼容性:** 支持 Compiz 等主要扩展(通过 TFP),并能通过 X.Org X 测试套件 (xts5) 的部分测试。 * **集成能力:** 可通过 LightDM 等显示管理器进行部署,也可通过 `startx` 独立运行。 * **性能与设计:** 在优先考虑现代标准的同时,保持了足以支持实际桌面工作流的功能。 本项目采用 MIT 许可证,旨在为寻求轻量级、模块化 X11 实现且无需遗留服务器架构负担的用户提供一个专注的替代方案。

The release of **Yserver**, a modern X11 server written in Rust, has sparked a divisive debate on Hacker News. While some users appreciate the project as an educational journey into X11 internals and a showcase for AI-assisted development, a significant portion of the community has dismissed it as "slop"—low-effort code generated by LLMs without deep human oversight. Technical discussions in the thread centered on: * **The "Legacy" Label:** Critics questioned the developer's decision to exclude support for multiple screens, which users argued is a standard requirement for modern setups. * **X11 vs. Wayland:** A lively sub-thread debated the merits of the aging X11 protocol versus Wayland. While Wayland is increasingly the default, proponents of X11 defended its continued relevance, particularly for "GUI over network" use cases and its reliability. * **The Role of AI:** The discourse highlighted a growing cultural clash on the platform. Skeptics argued that AI-generated projects lack soul and utility, while proponents countered that AI-assisted coding is a valid, powerful tool for personal learning and exploration, regardless of the end product's market value.
相关文章

原文

A modern X11 server written from scratch in Rust.

The goal is not to clone Xorg. It is to provide a practical X11 server that runs real desktop environments, window managers, and applications on modern Linux while dropping legacy baggage (multiple screens, non-TrueColor visuals, indirect GLX, the DDX driver ABI, endian-swapped clients, and so on).

See docs/high-level-design.md for the full design and scope.

The yserver name is the 'working' name as it was the first idea that popped into my head when starting the project. But there are multiple projects on GitHub with this name (but none for X11 servers), the name is subject to change. Not a priority now.

yserver (standalone DRM/KMS) can now run full MATE/XFCE/Cinnamon desktops. Other tested window managers include FVWM3, e16 and wmaker.

We support the following extensions:

  • BIG-REQUESTS
  • Composite
  • DAMAGE
  • DPMS
  • DRI3
  • GLX
  • Generic Event Extension
  • MIT-SCREEN-SAVER
  • MIT-SHM
  • Present
  • RANDR
  • RENDER
  • SHAPE
  • SYNC
  • X-Resource
  • XFIXES
  • XInputExtension
  • XC-MISC
  • XKEYBOARD
  • XTEST

GLX_EXT_texture_from_pixmap

Implemented and tested on AMD, intel, Asahi and Qualcomm. It can NOT (read: NEVER) work on nvidia proprietary driver, and on the only nvidia card I have (GTX 1050), the nouveau driver can not even bring up Xorg. Nouveau may work on other cards, but untested.

With TFP implemented, we now support compiz, demo here:

compiz-720p.mp4

yserver (standalone DRM/KMS) has been tested end-to-end against a MATE / xfce4 / Cinnamon desktop on:

  • AMD — Ryzen 9 6900HX (Rembrandt, RDNA2, RADV); i9 13900k + RX580 (Polaris/GCN4, RADV).
  • Intel — i5-7200U (Kaby Lake, ANV) iGPU.
  • NVIDIA — i5 6500 with GTX 1050 (proprietary driver).
  • Snapdragon X1 X1E80100 (Adreno X1, Turnip).
  • Apple M1 MBA, M2 MBP on Asahi Linux (apple-drm KMS + asahi GPU, Mesa AGX-V).
  • Virtual — virtio-gpu inside virtme-ng (Venus passthrough).

Running the standalone DRM/KMS server

yserver uses libseat for seat management if available. It can also drive atomic KMS directly, but then your user needs access to /dev/dri/ and to /dev/input/.

It requires a recent stable Rust toolchain and the following dependencies:

sudo pacman -S just gcc seatd libxshmfence libxkbcommon libinput shaderc systemd-libs fontconfig
sudo apt install just gcc libseat-dev libxshmfence-dev libxkbcommon-dev libinput-dev glslc libudev-dev libfontconfig-dev
export RUSTFLAGS="-C target-feature=-crt-static"
apk add gcc musl-dev fontconfig-dev freetype-dev libxshmfence-dev libxkbcommon-dev libinput-dev libseat-dev shaderc

Use with a display manager (lightdm)

lightdm can launch yserver as its X server for a graphical login (its X-server command is configurable, unlike gdm/sddm).

  1. Install the binary (requires sudo): just install (installs it at /usr/local/bin/yserver).
  2. Point lightdm at it — create /etc/lightdm/lightdm.conf.d/99-yserver.conf:
[Seat:*]
xserver-command=/usr/local/bin/yserver
  1. From a free TTY, restart lightdm: sudo systemctl restart lightdm.

The greeter appears, you log in, and the login keyring is unlocked by lightdm's PAM stack.

## switch to a free TTY, then run:
just startx

which will start yserver and then execute your ~/.xinitrc (or fall back to /etc/X11/xinit/xinitrc)

Some convenience keybinds are available:

  • Ctrl-Alt-Backspace: zap the server, return to console
  • Ctrl-Alt-Enter: create a screenshot/scanout of the framebuffer in CWD
  • Ctrl-Alt-D: dump all drawables as PPM files to CWD

Regression coverage with xts5 and rendercheck

We run the X.Org X Test Suite (xts5) against yserver to gauge protocol completeness.

Latest pass numbers per scenario live in docs/test-status.md.

This project is licensed under the MIT license. Please check LICENSE.

联系我们 contact @ memedata.com