1
0
Fork
You've already forked ewm
0
forked from ezemtsov/ewm
EWM - Emacs Wayland Manager
  • Rust 88.5%
  • Emacs Lisp 10.2%
  • Nix 1%
  • Shell 0.3%
Find a file
Evgeny Zemtsov b7cdaff15e fix(module): accept both int and float for f64 parameters
Emacs module f64 parameters reject integer values. Add value_as_f64()
helper that tries float first, falls back to int-as-f64. Applied to
warp_pointer_module, configure_output_module scale, and accel_speed.
2026年04月16日 09:48:46 +02:00
compositor fix(module): accept both int and float for f64 parameters 2026年04月16日 09:48:46 +02:00
docs feat: add idle inhibition support (Wayland protocol, D-Bus, fullscreen heuristic, Emacs command) 2026年04月13日 12:27:21 +02:00
etc feat(surface): track shell CWD in surface buffers 2026年02月25日 16:20:27 +01:00
lisp fix(module): accept both int and float for f64 parameters 2026年04月16日 09:48:46 +02:00
nix feat: add zwp-virtual-keyboard-v1 protocol support 2026年04月04日 17:06:01 +02:00
resources fix(session): handle display-manager restart by stopping stale service 2026年03月04日 22:57:46 +01:00
.envrc chore: update gitignore and add .envrc 2026年02月07日 20:09:01 +01:00
.gitignore docs: move diagrams to docs/diagrams/, add input methods diagram 2026年02月24日 13:12:35 +01:00
flake.lock Add flake.nix 2026年03月02日 18:17:57 +01:00
flake.nix Add flake.nix 2026年03月02日 18:17:57 +01:00
LICENSE docs: rewrite README and add LICENSE 2026年02月07日 20:09:01 +01:00
README.md docs: remove kill combo from README quick start 2026年03月22日 12:19:11 +01:00
shell.nix feat(drm): enable display-info EDID 2026年03月05日 17:41:10 +01:00

EWM - Emacs Wayland Manager

EWM Screenshot

Disclaimer: Writing a Wayland compositor from scratch is a staggering amount of work. I wanted to switch from EXWM as soon as possible, so the initial bootstrap was done with Claude, which helped a lot in reverse-engineering the brilliant niri codebase and surgically extracting the pieces relevant to EWM. Inherently, this means the codebase still needs validation and cleanup, which is the current priority.

What is EWM?

EWM is a Wayland compositor that runs inside Emacs. Wayland applications appear as Emacs buffers, letting you switch between code and apps with C-x b, organize windows with your familiar Emacs commands, and keep everything responsive even when Emacs is busy evaluating.

The compositor runs as a separate thread within Emacs (via a dynamic module), so applications never freeze waiting for Elisp evaluation.

┌─ Emacs Process ────────────────────────────────────────────┐
│ Main Thread: Elisp execution │
│ ↑↓ shared memory, mutex-protected │
│ Compositor Thread: Smithay (Rust dynamic module) │
│ ↑↓ │
│ Render Thread: DRM/GPU │
└────────────────────────────────────────────────────────────┘

Quick Start

cd compositor && cargo build --features=screencast
EWM_MODULE_PATH=$(pwd)/target/debug/libewm_core.so \
 emacs --fg-daemon -L ../lisp -l ewm -f ewm-start-module

Launch apps with s-d. See the wiki for full setup, configuration, and NixOS instructions.

Current Features

  • Wayland surfaces as Emacs buffers
  • Automatic layout synchronization
  • Per-output declarative layout (surfaces can span multiple outputs)
  • Per-window fullscreen (XDG fullscreen protocol, s-f toggle)
  • Prefix key interception (compositor forwards to Emacs)
  • Client-side decoration auto-disable
  • DRM backend with multi-monitor support (hotplug, per-output Emacs frames)
  • Lid close/open handling (laptop panel off when external monitor connected)
  • Layer-shell protocol (waybar, notifications, etc.)
  • Workspace protocol (ext-workspace-v1, tab-bar integration)
  • Screen sharing via xdg-desktop-portal (PipeWire DMA-BUF)
  • Input method support (type in any script via Emacs input methods)
  • Clipboard integration with Emacs kill-ring as central hub
  • Screen locking via ext-session-lock-v1 (swaylock)
  • Idle notification via ext-idle-notify-v1 (swayidle)
  • XDG activation (focus requests from apps)
  • Fractional output scaling (1.25x, 1.5x, etc.)

Known Limitations

  • GPU selection is automatic (no override)
  • Must run from TTY (no nested mode)

Inspirations

  • EXWM (Emacs side): Buffer-per-window model, prefix key interception, automatic focus management
  • niri (Compositor side): Backend architecture, Smithay patterns, DRM abstraction

License

GPL-3.0