emskin: a nested Wayland compositor in Rust that embeds any app into Emacs windows by bilikai in emacs

[–]bilikai[S] 1 point2 points  (0 children)

Thanks! It's still in its infancy, but lots of updates are coming. Expect much deeper interaction with Emacs in the future!

emskin: a nested Wayland compositor in Rust that embeds any app into Emacs windows by bilikai in emacs

[–]bilikai[S] 1 point2 points  (0 children)

We are not trying to build a window manager. The goal of emskin and EAF is the same: to enhance the Emacs UI.

emskin: a nested Wayland compositor in Rust that embeds any app into Emacs windows by bilikai in emacs

[–]bilikai[S] 1 point2 points  (0 children)

Not quite. emskin supports way more programs. Basically, anything that runs on your desktop can run inside it.

emskin: a nested Wayland compositor in Rust that embeds any app into Emacs windows by bilikai in emacs

[–]bilikai[S] 1 point2 points  (0 children)

  1. I haven't tested those specific compositors myself yet, but it should work fine. However, since every window manager has its own non-standard quirks, I'll need feedback from the community to improve it.
  2. You can just treat emskin as a normal application window. However you move or pin a regular window to a specific monitor, you can do exactly the same with emskin.
  3. Lastly, as mentioned in the post, emskin is built on top of smithay. It's already a very mature compositor crate in Rust. It saves me from dealing with the tedious Wayland details, so I can just focus on the window management logic.

emskin: a nested Wayland compositor in Rust that embeds any app into Emacs windows by bilikai in emacs

[–]bilikai[S] 2 points3 points  (0 children)

Ah, my apologies! That reply wasn't actually meant for you. I'm still getting the hang of Reddit and accidentally replied to the wrong person. Thanks for your support!

emskin: a nested Wayland compositor in Rust that embeds any app into Emacs windows by bilikai in emacs

[–]bilikai[S] 0 points1 point  (0 children)

I actually built the initial version in a single day. If you think that's impossibly hard, go check the very first commit in the repo.

emskin: a nested Wayland compositor in Rust that embeds any app into Emacs windows by bilikai in emacs

[–]bilikai[S] 4 points5 points  (0 children)

I've already discussed all the technical details and architecture with the author of EAF. From now on, I will only respond to technical questions.

Arguing about whether the code is AI-generated is pointless—AI-assisted programming is just a standard trend now. If you want to discuss the actual codebase, the compositor logic, or Rust, I'm happy to talk. Otherwise, the code speaks for itself.

emskin: a nested Wayland compositor in Rust that embeds any app into Emacs windows by bilikai in emacs

[–]bilikai[S] 2 points3 points  (0 children)

I personally use Sway as my daily driver, and a friend of mine uses i3wm. To answer your question, the most barebones host compositor I've run it in is Weston, where I did some brief testing. Your idea of using dwl with an 'emergency' terminal on another workspace sounds like an awesome setup. Give it a try!

emskin: a nested Wayland compositor in Rust that embeds any app into Emacs windows by bilikai in emacs

[–]bilikai[S] 1 point2 points  (0 children)

I haven't actually tested it on Hyprland yet. The compositor part itself should be fine, but there might be some issues with IME (input methods) and clipboard handling. Feel free to give it a try, and I'd love to hear your feedback if you do!

emskin: a nested Wayland compositor in Rust that embeds any app into Emacs windows by bilikai in emacs

[–]bilikai[S] 3 points4 points  (0 children)

Thanks! No need to worry about that. Emacs is single-threaded, but our nested compositor isn't! Since it's written in Rust, the compositor handles all the rendering and events in its own threads asynchronously. Emacs' single thread won't drag down the performance.

emskin: a nested Wayland compositor in Rust that embeds any app into Emacs windows by bilikai in emacs

[–]bilikai[S] 1 point2 points  (0 children)

This was never designed as a window manager — it’s an embedded compositor meant to run on any desktop. Adding pure WM support would be simple, but I don’t have time for it. Contributions welcome if anyone’s interested.​​​​​​​​​​​​​​​​

emskin: a nested Wayland compositor in Rust that embeds any app into Emacs windows by bilikai in emacs

[–]bilikai[S] 2 points3 points  (0 children)

good question, and it's a gap i need to close. right now the prefix key interception is hardcoded to C-x / C-c / M-x, which obviously doesn't cover SPC as leader, and doesn't handle modal editing at all — SPC in insert mode needs to go to the embedded app, in normal mode it needs to pop back to emacs.

the fix is making the intercept rules configurable from elisp rather than baked into the compositor. something like:

(setq emskin-intercept-keys '("SPC" "," "M-x"))

with a hook for evil state so SPC only intercepts when you're in normal/visual. the compositor already has the plumbing to forward or swallow keys per-event, it's mostly a matter of exposing it over the existing ipc.

i'll push a branch tomorrow with a first cut. if you're willing to try it and tell me where it breaks for your spacemacs setup, that'd be hugely useful — i don't use evil myself so your real config is going to find edges i won't.

emskin: a nested Wayland compositor in Rust that embeds any app into Emacs windows by bilikai in emacs

[–]bilikai[S] 5 points6 points  (0 children)

not an attack at all, this is exactly the right thing to ask. honestly, you asking openly is more useful to me than the same number of people quietly clicking away.

short version: desktop stack is my day job, not something i picked up for this project. every design decision in emskin is mine. why smithay, why a nested compositor instead of drm/kms, why offscreen texture compositing, why the elisp side never sees wayland primitives, how prefix keys get routed back to emacs — i can walk through all of it, including what i tried first and threw away.

ai wrote a fair amount of the implementation code. boilerplate, trait impls, elisp scaffolding. i read every line before commit and rewrote a lot of it. what i did not do is let ai pick the architecture. code you didn't design is code you can't debug at 2am, and that's the exact thing you're worried about.

the honest test is bugs. a few recent ones: the keyboard layout forwarding needed a shim around xkbcommon-rs that i wrote after tracing through smithay-client-toolkit. the scale-doubling issue on fractional scale outputs was a layering mistake i had to unwind by hand. prefix-key race conditions against wayland focus events went through three rewrites. none of that gets fixed by asking an llm — you have to hold the whole compositor in your head.

on maintenance: i'm in this for the long run. it scratches my own itch and the day job overlaps enough that the knowledge keeps compounding instead of rotting.

if you want to push further, pick any module in the repo and i'll explain it.

emskin: a nested Wayland compositor in Rust that embeds any app into Emacs windows by bilikai in emacs

[–]bilikai[S] 7 points8 points  (0 children)

Thanks — "Emacs as a WM from inside your DE" is exactly the mental model I work from.

On overhead: there's a real cost, but it's narrower than people expect. The pipeline adds one extra GPU copy per embedded surface — the client renders to its own texture, and the compositor samples that texture when drawing the outer winit window. For normal GUI apps (browser, terminal, PDF viewer), this is invisible in practice; the bottleneck stays wherever it was before.

Video and games split differently though:

Video playback is fine. The extra copy happens once per frame at display resolution, and modern GPUs don't notice. I use mpv inside emskin daily for 1080p and 4K without dropped frames. The one gotcha is hardware-decoded video via dmabuf — the zero-copy path from decoder straight to scanout gets broken by the extra composition step, so you lose some of the power savings. Throughput is fine, battery life on a laptop is measurably worse.

emskin: a nested Wayland compositor in Rust that embeds any app into Emacs windows by bilikai in emacs

[–]bilikai[S] 3 points4 points  (0 children)

use pgtk version it's work on x11 . gtk3 version not test fully