Wallrus
<p align="center">
<img src="./wallrus_logo.svg" width="128" height="128" alt="wallrus logo" />
</p>
<h1 align="center">wallrus</h1>
<p align="center">
<strong>Agent-first Three.js live 3D wallpaper engine in Rust for Linux & macOS.</strong><br/>
Zero-asset ES modules · 3D cursor depth parallax · Spotlight orbit & WASD camera · Built-in Agent Skills & MCP Server
</p>
<p align="center">
<a href="https://wallrus.pages.dev/demos/frosted-glass-macos.mp4"><img src="https://wallrus.pages.dev/thumbs/frosted_glass_garden.webp" width="640" alt="Frosted Glass Garden, a Wallrus wallpaper scene" /></a>
</p>
<p align="center">
Orbit the scene, pin your angle, and see it respond to your cursor as you work.<br/>
<a href="https://wallrus.pages.dev/demos/frosted-glass-macos.mp4">Watch on macOS (22s)</a> ·
<a href="https://wallrus.pages.dev/demos/frosted-glass-linux.mp4">Watch on Hyprland (17s)</a> ·
<a href="https://github.com/joexk1/wallrus/releases/latest">Download</a>
</p>
<p align="center">
<a href="https://wallrus.pages.dev">Live Gallery (wallrus.pages.dev)</a> ·
<a href="#installation">Installation</a> ·
<a href="#agent-skills--tools-pack">Agent Skills & MCP Pack</a> ·
<a href="#cli-reference">CLI Reference</a> ·
<a href="#configuration--ricing">Configuration & Ricing</a>
</p>
---
Point any coding agent (**Claude Code, Codex, Antigravity, Cursor, OpenCode, Windsurf**) at this repository — or browse **[wallrus.pages.dev](https://wallrus.pages.dev)** — and ask:
> *"Build me an interactive 3D wallpaper and set it with wallrus."*
Your agent reads [`AGENTS.md`](./AGENTS.md) and the bundled [`skills/wallrus/`](./skills/wallrus/) pack, writes a single zero-asset Three.js `.js` module, validates it with `wallrus check` + `wallrus set`, visually inspects the rendered WebGL backbuffer via `wallrus screenshot` (without ever capturing your open windows), and hot-swaps it onto your Linux or macOS desktop in milliseconds.
---
## Features
- **Unified Native Linux & macOS Engine (Single Rust Binary)**:
- **macOS (Apple Silicon / Aqua)**: Renders via Metal-backed `WKWebView` at `kCGDesktopIconWindowLevel - 1` edge-to-edge behind the translucent Menu Bar & Camera Notch while keeping Desktop icons and Finder windows cleanly on top. Zero Dock icon clutter, zero TCC/Accessibility permission prompts (`CGEventGetLocation` 30Hz cursor tracking + Carbon `RegisterEventHotKey` `⌃⌥I`).
- **Linux (Wayland & X11)**: Native `zwlr_layer_shell_v1` (`gtk-layer-shell`) on **Hyprland, Sway, Niri, KDE Wayland, COSMIC**, automatic `_NET_WM_WINDOW_TYPE_DESKTOP` fallback on **GNOME / X11**, and zero-overhead Hyprland socket cursor tracking (`Ctrl+Alt+I` Interactive Mode).
- **True 3D Window-Pivot Cursor Parallax + Interactive Spotlight Mode**:
- Smooth 3D perspective depth parallax tracks your desktop cursor passively while you work.
- Press **`Ctrl + Alt + I`** (Linux) or **`⌃⌥I`** (`Ctrl + Option + I`, macOS) to elevate the wallpaper into Interactive Spotlight Mode: orbit/pan/zoom with your mouse, fly through the scene with **`WASD` + `Q`/`E` (+ `Shift`)**, toggle scene presets (`1`–`9`, `Space`), tune parallax depth live, and press **`Esc`** to pin your new camera angle permanently (seamlessly returning focus to your active window).
- **Zero `npm install` — Everything Pre-Bundled Offline**:
- Embeds Three.js `r170`, `OrbitControls`, `EffectComposer`, `UnrealBloomPass`, `Sky`, `Water`, `RoundedBoxGeometry`, `BufferGeometryUtils`, and seeded 2D/3D Simplex, FBM, and Ridged procedural noise directly inside the binary.
- Runs ergonomic `export function setup(ctx)` modules, vanilla Three.js `.js` scripts, standalone `.html` scenes, and direct `https://` URLs.
- **Canonical Scene Checker & Crash-Proof Hot-Swap**:
- Shared verification across `wallrus check`, `wallrus set`, and `wallrus.pages.dev` uploads blocks desktop-hijacking patterns (`PointerLockControls`, audio autoplay, gamepads, runaway draw-call/triangle budgets) and validates GLSL compilation before swapping — rolling back cleanly on error so your desktop never breaks.
- **Smart Battery & Fullscreen Power Policy**:
- Automatically drops to **0% GPU** when your display is asleep/locked or covered by a fullscreen game/video, and scales background FPS on battery power.
---
## Installation
### Option 1: Download Prebuilt Release (`macOS arm64` / `Linux x86_64`)
Download the archive for your platform from [**GitHub Releases**](../../releases/latest):
```bash
# macOS (Apple Silicon — M1 / M2 / M3 / M4)
curl -fsSL https://github.com/joexk1/wallrus/releases/latest/download/wallrus-v0.1.0-aarch64-apple-darwin.tar.gz | tar -xz
mkdir -p ~/.local/bin && mv wallrus ~/.local/bin/
export PATH="$HOME/.local/bin:$PATH"
wallrus install-skill && wallrus bind && wallrus enable
# Linux (x86_64 — Arch / Ubuntu / Fedora; requires webkit2gtk-4.1 & gtk-layer-shell)
curl -fsSL https://github.com/joexk1/wallrus/releases/latest/download/wallrus-v0.1.0-x86_64-unknown-linux-gnu.tar.gz | tar -xz
mkdir -p ~/.local/bin && mv wallrus ~/.local/bin/
wallrus install-skill && wallrus bind && wallrus enable
```
### Option 2: Build from Source
**Prerequisites:**
- **macOS**: Rust toolchain (`rustup`) + Xcode Command Line Tools (`xcode-select --install`). No Homebrew runtime libraries required.
- **Linux**: Rust toolchain (`rustup`), `gtk3`, `gtk-layer-shell`, and `webkit2gtk-4.1` (e.g., `sudo pacman -S webkit2gtk-4.1 gtk-layer-shell` on Arch, or `sudo apt install libwebkit2gtk-4.1-dev libgtk-layer-shell-dev` on Ubuntu/Debian).
```bash
git clone https://github.com/joexk1/wallrus.git
cd wallrus
./install.sh
```
`./install.sh` compiles the optimized release binary, links `~/.local/bin/wallrus`, installs the **Agent Skills & Tools Pack**, and runs `wallrus doctor`.
---
## Quick Start
```bash
# Launch a bundled procedural 3D wallpaper
wallrus set ./library/alpine_peaks.js
# Or stream directly from the online gallery
wallrus set https://wallrus.pages.dev/scenes/gargantua_black_hole.js
# Pick a random scene from ./library/ or the online catalog
wallrus random
wallrus random --online
# Bind Interactive Spotlight shortcut (Ctrl+Alt+I on Linux, ⌃⌥I on macOS) & login autostart
wallrus bind
wallrus enable
```
### Interactive Spotlight Controls (`Ctrl+Alt+I` on Linux · `⌃⌥I` on macOS)
| Input | Action |
|---|---|
| `Left Drag` / `Right Drag` | Smooth damped orbit / pan |
| `Scroll` | Dolly zoom (with automatic near/far frustum protection) |
| `W` `A` `S` `D` / `Q` `E` (`Shift`) | Fly camera through 3D space (Shift = 2.6x boost) |
| `1` – `9` / `Space` | Trigger scene lighting, weather, or shader presets |
| `P` / HUD Slider | Toggle 3D cursor parallax or adjust depth intensity (`0%`–`200%`) |
| `R` | Reset camera back to the scene's default composition |
| `Esc` | Pin current camera angle to desktop & return focus to your active app |
---
## Agent Skills & Tools Pack
`wallrus` ships with a complete, self-contained **Skills & Tools Pack** in [`skills/wallrus/`](./skills/wallrus/) (also embedded inside the `wallrus` binary and installed automatically via `wallrus install-skill` into `~/.agents/skills/wallrus/` and `~/.claude/skills/wallrus/`):
```
skills/wallrus/
├── SKILL.md # Closed-loop agent workflow, ES module contract & guardrails
├── templates/
│ └── starter_scene.js # Zero-asset Three.js starter scene (bloom, ridged noise, presets)
├── references/
│ └── scene-recipes.md # Procedural terrain, GLSL sky domes, 3-plane parallax & HUD ricing
├── scripts/
│ └── verify-scene.sh # One-command check -> set -> WebGL screenshot -> JSON status
└── tools/
└── mcp.json # Ready-to-use Model Context Protocol (MCP) server config
```
### Built-In MCP Server (`wallrus mcp`)
Add `wallrus` to Claude Code, Claude Desktop, Cursor, Antigravity, or Windsurf:
```json
{
"mcpServers": {
"wallrus": {
"command": "wallrus",
"args": ["mcp"]
}
}
}
```
Exposed MCP tools:
- `get_scene_contract` — Full Three.js ES module contract, pre-bundled imports, and noise API
- `check_scene` — Validates source size, module exports, and anti-game guardrails
- `set_wallpaper_scene` — Hot-swaps a wallpaper from `path` or inline `code` with GLSL error rollback
- `capture_scene_screenshot` — Privacy-safe PNG capture directly from the WebGL backbuffer
- `send_scene_event` — Live JSON event dispatch (`ctx.onEvent`) without reloading
- `toggle_interactive_mode` — Switches Spotlight Mode (`on` / `off` / `toggle`)
- `get_wallpaper_status` — Live FPS, GPU renderer, active scene, cursor, and error logs
---
## CLI Reference
```bash
wallrus set <path|url> # Validate & hot-swap .js, .html, or https:// scene
wallrus check <path> # Run canonical contract & anti-game guardrail check
wallrus list # List discovered local scenes
wallrus random [--online] # Load a random local or wallrus.pages.dev scene
wallrus interact [on|off|toggle] # Toggle Interactive Spotlight Mode
wallrus send <event> '<json>' # Push live JSON event into ctx.onEvent(...)
wallrus screenshot [out.png] # Capture pure WebGL backbuffer PNG (privacy-safe)
wallrus status [--json] # Inspect daemon FPS, layer, GPU, and system metrics
wallrus config --init|--show # Scaffold or inspect ~/.config/wallrus/config.toml
wallrus hud --position <pos> --theme <theme>
wallrus bind [--key <chord>] # Bind global shortcut (Ctrl+Alt+I / ⌃⌥I)
wallrus enable / disable # Enable/disable login autostart (systemd / LaunchAgent)
wallrus install-skill # Install Agent Skills & Tools Pack to ~/.agents & ~/.claude
wallrus schema [--starter] # Print full scene contract or starter template to stdout
wallrus mcp # Start stdio JSON-RPC 2.0 MCP server
wallrus doctor [--json] # Run environment & compositor diagnostics
```
---
## Configuration & Ricing
Both `~/.config/wallrus/config.toml` and `~/.config/wallrus/hud.css` **hot-reload within 250ms** whenever saved:
```toml
# ~/.config/wallrus/config.toml
[general]
layer = "background"
fps_limit = 60
[power]
pause_when_fullscreen = true
pause_when_locked = true
[camera]
parallax = true
parallax_strength = 1.00
wasd_speed = 1.00
[hud]
position = "bottom" # bottom | top | bottom-left | bottom-right | top-left | top-right | bar | hidden
theme = "catppuccin" # default | catppuccin | tokyo-night | gruvbox | nord | rose-pine | kanagawa | transparent
shortcut = "ctrl+opt+i" # "CTRL ALT, I" on Hyprland/Linux · "ctrl+opt+i" (⌃⌥I) on macOS
```
---
## License
Released under the [MIT License](./LICENSE).
This server cannot be deployed
TDQS
Scored across 7 tools
Each tool targets a distinct action: reading the contract, setting a scene, screenshotting, dispatching events, toggling mode, reading telemetry, and validating. The one soft boundary is between check_scene (pre-deploy validation) and set_wallpaper_scene (which also validates and returns shader errors), which could cause an agent to pick the wrong one when it just wants to test code.
All seven names are snake_case verb_noun phrases (get_*, set_*, capture_*, send_*, toggle_*, check_*), which is highly predictable. The only wrinkle is noun drift between 'scene' and 'wallpaper' for what is essentially the same object, though meaning remains clear.
Seven tools is tightly scoped around a single domain: authoring, validating, deploying, inspecting, and interacting with live Three.js wallpapers. Every tool maps to a step in the create-deploy-observe loop with no filler.
The lifecycle is well covered: contract discovery, validation, deploy, visual verification, status telemetry, event injection, and mode switching. Gaps are minor but real: no way to enumerate stored wallpapers, clear/unset a wallpaper, or delete a scene, so cleanup and discovery workflows are dead ends.