Show HN: 一个拥有自有合成器与 GUI 工具包的 30 万行 Zig 桌面环境
Show HN: A 300k-line Zig desktop environment with its own compositor,GUI toolkit

原始链接: https://github.com/oxydizer/rediwm

RediWM 是一个基于 wlroots 的 Wayland 合成器,整个桌面 Shell 在一个进程中运行,包括任务栏、菜单、设置、锁屏/登录屏幕、通知和 OSD。它提供平铺和堆叠布局、内置应用和实用工具、多显示器支持、夜灯、基于 PAM 的锁屏/登录屏幕与可选显示管理器、支持操作、图片和勿扰模式的通知守护进程,以及 Xwayland 原生缩放。它兼容常见 Wayland 工具,并提供包括 Panorama Mode 在内的大量键盘快捷键。可通过脚本、Nix 安装,或使用 Zig 和 wlroots 从源码构建。配置存储在 `config.toml`,支持每窗口规则,并通过 `rediwm-msg` 提供 JSON IPC。自动化为可选启用,且锁定状态下 IPC 请求会被拒绝。RediWM 的代码采用 Apache-2.0 或 MIT 双重许可,捆绑的字体和光标保留各自许可证。

黑客新闻 新 | 过去 | 评论 | 提问 | 展示 | 工作 | 提交 登录 Show HN:一个 300k 行 Zig 桌面环境,带有自己的合成器、GUI 工具包 ( github.com/oxydizer ) 13 点 由 oxydizer 1 小时前 | 过去 | 收藏 | 3 条评论 拆分: - 300k 行 Zig — 核心桌面与应用程序。 - 21k 行 C — 支撑实现。 - 61k 行 Python — 测试基础设施。 rediwm.redios.org 如果你想看视觉导览。 谢谢! 帮助 DeepLogin 3 分钟前 | 下一个 [–] 它支持 Vulkan 吗? 回复 oxydizer 2 分钟前 | 父级 | 下一个 [–] 支持,带 HDR 回复 truekonrads 16 分钟前 | 上一个 [–] 轻快。不知怎的让我想起 e16 回复 指南 | 常见问题 | 列表 | API | 安全 | 法律 | 申请 YC | 联系 搜索:
相关文章

原文

RediWM is a wlroots Wayland compositor that draws its entire desktop shell in one process: taskbar, start menu, settings, lock and login screens, notifications and on-screen displays.

No separate bar to configure. No launcher to bolt on. No notification daemon to wire up. Just one desktop, built together.

Wayland_Compositor_Showcase.mp4
From start to desktop Compositor + desktop shell Idle RAM usage Idle CPU usage


Xwayland native scaling keeps X11 applications sharp on high-density displays. PAM-backed lock and login screens, with the optional rediwm-dm display manager. A built-in notification daemon with actions, images and do-not-disturb rules.
Adjust the display colour temperature with the built-in night light. Use multiple monitors in the same desktop session.

Tiling / stacking layouts

Arrange windows using tiling or stacking layouts.

Built-in shell and apps. Taskbar, start menu, desktop icons, settings, file manager, image/PDF viewer and text editor. No separate Waybar, greeter, launcher or notification daemon is required.

Wayland tools. Works with wlr-randr, kanshi, swaylock, swayidle, grim, wf-recorder, wayvnc and docks.

Arch and derivatives — including Artix and CachyOS — Debian, Ubuntu and Fedora:

curl -fsSL https://rediwm.redios.org/install.sh | sh
🔐 Include the optional RediWM display manager

Install the prebuilt release together with rediwm-dm:

curl -fsSL https://rediwm.redios.org/install.sh | sh -s -- --dm

Use the flake and NixOS module, not the shell installer above.

To build just the package, without configuring a login session:

nix build github:oxydizer/rediwm

Requires Zig 0.17, wlroots 0.20, and the development dependencies below.

📦 Full dependency list

Wayland, wayland-protocols, xkbcommon, libxcb (including xcb-xinput), pixman, FreeType, HarfBuzz, Fontconfig, librsvg/GdkPixbuf, PangoCairo, libinput, PAM, libpulse, libpipewire-0.3, Poppler GLib, libarchive, libjpeg, libpng, libwebp and GNU Readline.

# Try it nested inside your current Wayland session
zig build run -- foot

# Build for daily use and measurements
zig build -Doptimize=ReleaseSafe

# Install the session and restart the running session
sh scripts/install-session.sh

# Or install without restarting, including rediwm-dm
sh scripts/install-session.sh --no-restart --dm

For custom prefixes and distribution packages, see Installation layouts and packaging.


⌨️ Keyboard shortcuts

Keys Action
Super + Space Open the centred app launcher
Super + T / E / B Terminal / Files / browser
Super + Q / F / M Close / fullscreen / maximise
Super + ← → ↑ ↓ Slide to the neighbouring desktop
Super + Ctrl + arrows Focus the window in that direction
Super + P Toggle Panorama Mode
Alt + Tab Switch windows
Super + 1…5 or = / - / 0 Zoom a window
Super + Shift + = / - / 0 Zoom the desktop
Super + L Lock the screen
Ctrl + Shift + S / Print Region / full-screen screenshot
Super + Z Undo the last window move or resize
Super + Shift + E Quit RediWM

Canvas bindings live in [keybinds]; set one to "noop" to disable it.

Panorama works with every Desktop mode and opens on the focused display. Side workspaces are laid out in a narrower box with the proportions of their pane, so their windows are not squeezed: tiled and maximized windows there are resized to fit it, and resized back when they return to the center. Floating windows keep their size. Move the pointer toward the outside edge of a side pane to turn it toward you for reading: it grows to the full height in the same proportions. At the edge, the pane becomes rectangular and stays that way until the pointer leaves it. Use windows directly in all three panes. Drag a window by its titlebar into a side pane to maximize it there. Super+Left/Right changes the center workspace. In Settings → Desktop → Panorama Mode, adjust Perspective angle, Peripheral width, Peripheral height, Overall height, and Pane zoom. By default, the outer edges of the side panes grow 40% of the way to the full perspective height. The other defaults are 65% perspective, 22% of the available width per side, 90% overall vertical scale, and 110% zoom in all three panes. Zoom keeps the top and right edges in view for window controls.

$XDG_CONFIG_HOME/rediwm/config.toml

RediWM writes commented defaults on first run and reloads on save. A parse error keeps the previous configuration active. Set REDIWM_CONFIG to override the path.

🗂️ Configuration sections

[theme] · [input] · [input_method] · [compositor] · [region] · [idle] · [night_light] · [notifications] · [desktop] · [polkit] · [ipc] · and more.

🪟 Per-window rules and a Picture-in-Picture example

Window rules match by globs. For each property, the last matching rule wins.

[[window_rules]]
app_id = ["firefox", "chromium"]
title = "*Picture-in-Picture*"
opacity = 0.9
skip_taskbar = true
focus = false

Matchers: app_id, title, x11_class, x11_instance, backend, dialog and exclude_*.

Properties: output, x, y, center, width, height, maximized, fullscreen, focus, depth, opacity, decorations and skip_taskbar.

Use rediwm-msg to talk to RediWM's JSON IPC:

rediwm-msg outputs
rediwm-msg output-config DP-1 --scale 1.5
rediwm-msg notifications

The socket is $XDG_RUNTIME_DIR/rediwm-<WAYLAND_DISPLAY>.sock, or the path specified by REDIWM_SOCKET, in a private directory only. The protocol reference is src/ipc/protocol.zig.

📡 Wire format and request examples

IPC v1 is UTF-8 JSON, with one request and one response per newline. Every request uses the envelope below; command names are case-sensitive snake_case.

{"version":1,"id":1,"command":"windows"}
{"version":1,"id":2,"command":"move_cursor","params":{"x":100,"y":200}}

Automation is opt-in. Synthetic input and pixel reads require automation = true in [ipc], or REDIWM_IPC_AUTOMATION=1. All IPC requests are refused while locked.


Typography by Manrope and JetBrains Mono (SIL OFL 1.1). Cursors by phinger-cursors (CC BY-SA 4.0).

RediWM's own code is dual-licensed under either the Apache License, Version 2.0 or the MIT License.

Bundled third-party assets retain their own licenses: fonts in assets/fonts under SIL OFL 1.1, and cursors in assets/cursors under CC BY-SA 4.0.



One process. Your whole desktop.

RediWM · Built in Zig · Powered by wlroots

↑ Back to the top
联系我们 contact @ memedata.com