MCPcopy Index your code
hub / github.com/bea4dev/ShojiWM

github.com/bea4dev/ShojiWM @main

Chat with this repo
repository ↗ · DeepWiki ↗ · + Follow
3,390 symbols 9,589 edges 103 files 189 documented · 6%
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

ShojiWM

A highly customizable Wayland compositor configured with TypeScript/TSX.

Discord

Documents

Quick Start

Source installs are documented in the getting started guide. Experimental NixOS support is also available:

nix develop
npm ci
cargo run --release -p shoji_wm -- --dev

For NixOS module installation, see the installation docs.

Features

  • [x] Window management
  • [x] Animations
  • [x] Screenshots and screen sharing via xdg-desktop-portal-shojiwm
  • [x] XWayland support via xwayland-satellite
  • [x] Custom shaders
  • [x] Layer shell support
  • [x] Multi-monitor support
  • [x] Intel, AMD, and NVIDIA GPU support

Why not Niri or Hyprland?

Niri and Hyprland are, at their core, software that bundles a window manager and a compositor together.

ShojiWM is different. It provides only the compositor, plus window-manager functionality as a default config.

In other words, the window-manager part is something you can program entirely and freely yourself. That is exactly why it bills itself as "The most customizable Wayland compositor with TypeScript (tsx)."

Here is an example. The code below implements a window's close button. When you run it, the button's composition changes reactively on hover, so its appearance updates.

Image

const CloseButton = ({ window }: { window: WaylandWindow }) => {
  const [hover, setHover] = useState(false);

  const borderColor = hover((hover) => (hover ? "#00000000" : "#F0808030"));

  var icon: CompositionRenderable | null = null;
  if (hover()) {
    icon = (
      <Image
        src="https://github.com/bea4dev/ShojiWM/raw/main/assets/x.svg"
        style={{
          width: 16,
          height: 16,
          position: "absolute",
          zIndex: 1,
          pointerEvents: "none",
        }}
      />
    );
  }

  return (
    <Box style={{ position: "relative", flexShrink: 0 }}>
      <Button
        onHoverChange={setHover}
        style={{
          width: 16,
          height: 16,
          borderRadius: 8,
          background: "#FFFFFF20",
          border: { px: 1, color: borderColor },
        }}
        onClick={window.close}
      />
      {icon}
    </Box>
  );
};

How ShojiWM compares

How ShojiWM differs from two popular Wayland compositors, Niri and Hyprland.

Legend: ✅ Yes / built-in  ·  🟡 Partial / limited  ·  ❌ No

Capability Niri Hyprland ShojiWM
Server-side decoration (SSD) customization via a standard API
Build your own window-management strategy in TypeScript 🟡 1
Powerful custom shader pipeline API 🟡 2 🟡 3
Linux gaming support, including tearing 🟡 4
First-class xwayland-satellite support

1 Hyprland 0.55+ adds custom layouts and event scripting via Lua (not TypeScript); core WM behavior remains built-in.

2 Custom GLSL is limited to window open/close/resize animations.

3 A single full-screen screen shader, not a per-element pipeline.

4 Niri supports VRR (adaptive sync), but not a tearing / immediate-flip mode.

Comparison reflects each project at the time of writing; corrections are welcome.

Extension points exported contracts — how you extend this code

DecorationEvaluator (Interface)
Dynamic decoration evaluation boundary. This trait represents the future hand-off point to the Node/TS runtime. For now [3 …
src/shojiwm/src/ssd/evaluator.rs
ReactiveComputation (Interface)
(no doc) [4 implementers]
packages/shoji_wm/src/signals.ts
EvaluateRequest (Interface)
(no doc)
tools/decoration-runtime.ts
SnapPreviewRect (Interface)
(no doc)
packages/config/src/window-manager.ts
SharedEdgeGeometryLookup (Interface)
(no doc) [2 implementers]
src/shojiwm/src/ssd/integration.rs
KeyBindingController (Interface)
(no doc) [3 implementers]
packages/shoji_wm/src/types.ts
DrainPreloadRequest (Interface)
(no doc)
tools/decoration-runtime.ts
SnapPreviewPayload (Interface)
(no doc)
packages/config/src/window-manager.ts

Core symbols most depended-on inside this repo

clone
called by 840
src/shojiwm/src/ssd/evaluator.rs
get
called by 488
packages/shoji_wm/src/types.ts
is_empty
called by 263
src/shojiwm/src/protocols/screencopy.rs
push
called by 236
src/shojiwm/src/protocols/screencopy.rs
lock
called by 202
src/shojiwm/src/handlers/mod.rs
set
called by 200
packages/shoji_wm/src/types.ts
read
called by 198
packages/shoji_wm/src/signals.ts
collect
called by 154
src/shojiwm/src/backend/shader_effect.rs

Shape

Function 1,487
Method 1,193
Class 345
Interface 259
Enum 106

Languages

Rust66%
TypeScript34%

Modules by API surface

src/shojiwm/src/ssd/mod.rs252 symbols
src/shojiwm/src/ssd/integration.rs226 symbols
packages/config/src/window-manager.ts215 symbols
packages/shoji_wm/src/types.ts155 symbols
src/shojiwm/src/state.rs149 symbols
tools/decoration-runtime.ts148 symbols
src/shojiwm/src/backend/shader_effect.rs146 symbols
src/shojiwm/src/backend/tty.rs145 symbols
src/shojiwm/src/ssd/evaluator.rs130 symbols
packages/shoji_wm/src/events.ts117 symbols
src/shojiwm/src/ssd/window_model.rs71 symbols
src/shojiwm/src/backend/visual.rs70 symbols

For agents

$ claude mcp add ShojiWM \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact