Skip to main content
L

dsh-hyprland

libregml/dsh-hyprland

Control a Hyprland desktop from DeepSeek Harness: read screen text and element ids, click by identity, drive Firefox pages over WebDriver BiDi, arrange windows and wait on state, with a guard that refuses destructive controls. Linux only.

Install

dsh plugin --profile web add github:libregml/dsh-hyprland

README

dsh-hyprland

A computer-use plugin for Hyprland, built for DeepSeek Harness.

License: GPL-3.0 Tools Tests Hyprland Node

Reads the screen as text and elements instead of pixels, clicks by element identity instead of coordinates, drives the page inside Firefox over WebDriver BiDi, and refuses a destructive control before the pointer moves. 25 tools, no keybindings required, no side effects on your desktop config.


Capabilities

Read the screen

ToolActionsReturns
hypr_read—Visible text in reading order, actionable elements (id / role / label / state / rect) and tables (headers + rows) in one call; the DOM is preferred, AT-SPI is the fallback
hypr_look—A magnified capture with a labelled grid, cursor, markers, rectangles and a measure; reports the image-pixel to logical-coordinate mapping
hypr_overview—Every visible window as one contact sheet, each cell labelled with class, title and geometry
hypr_pixel—The composited colour at one point or a rectangle, up to 64 points per capture, blur and opacity included
hypr_capture—A screenshot plus the exact frame and scale that turns an image pixel into a click coordinate

Act on it

ToolActionsGuarantees
hypr_inputpointer key text scrollReal virtual-pointer input and keyboard combinations; target clicks by element id, expect waits for the result and reports verified
hypr_browserstatus enable attach tabs select open reload back forward text find tables click fill type key select-option check scroll hover wait prompt evaluate detachFirefox pages over WebDriver BiDi: clicks are real pointer actions verified by a DOM mutation, fill uses the native setter and reads the value back
hypr_a11yapps tree find text tables ensure activate set-text type value select focus scroll-to links document attributes hover waitThe GTK / Qt / Firefox accessibility tree: roles, labels, text, exact rectangles, and whether a page content is published at all
hypr_clipboardget set paste history decode typesThe Wayland clipboard and cliphist history; paste holds the clipboard until the client has read it

Arrange the desktop

ToolActionsNotes
hypr_statesections: summary version monitors workspaces windows activewindow activeworkspace layers devices binds submap cursor configerrors plugins layouts input pointer rawReads are cached against event generations, not a timer
hypr_windowfocus close kill float fullscreen pin pseudo center move resize swap cycle_next tag group_* zorder set_prop signalCoordinate moves are eased and only apply to floating windows
hypr_workspacefocus create rename move move_window swap_monitors toggle_special change_idSpecial (scratchpad) workspaces use special:name
hypr_layoutstate set message scroll helpPer-workspace or global layout, live layout messages, scrolling-tape navigation
hypr_monitorstate focus dpms configure fake_outputMode, position, scale, transform, mirror, reserved area, VRR, colour management

System actions, without keybindings

ToolActionsNotes
hypr_actvolume, microphone, media, brightness, keyboard backlight, airplane mode, touchpad, notifications, do-not-disturb, wallpaper, colour pick, screenshot, launcher, zoom, lock / suspend / power, plus history and undoEach action is implemented against the backend that exists (wpctl, pamixer, playerctl, brightnessctl, rfkill, swaync, awww) — your keybindings are never read
hypr_keysconfigs list press scripts scriptReads your Hyprland config, bindings and scripts, and can run one binding
hypr_execrun notifyLaunch through the compositor (window rules apply) or push a notification
hypr_barstatus toggle reloadReads bar layers and module labels; hiding and reloading is signal-driven
hypr_lockstatus lock clearclear only clears a crashed lockscreen, never a live one

Observe and wait

ToolActionsNotes
hypr_eventsrecent waitEvent stream with field filters; a timeout is an answer, not an error
hypr_waitsettle window gone layer layer-gone a11y text modal valueWaits on pixels, windows, layers, text, dialogs and field values
hypr_appstatus enable disable env-for relaunch probe-webview capabilitiesReports what this machine supports: accessibility content, browser bridge, OCR
hypr_configget set describe rules bind unbind binds reload errors400+ options, window / workspace / layer / monitor rules, runtime binds — all undoable
hypr_lua—Runs a Lua function body inside Hyprland's own persistent state
hypr_helpall computer pointer coordinates dispatchers rules events selectors layoutsBuilt-in reference, no guessing at dispatchers

Install

Hyprland only. The package declares dsh.bundle.platforms: ["linux"], so a non-Linux host refuses the bundle outright; on a Linux desktop without Hyprland the plugin refuses to load with one clear message instead of registering 25 tools that can only fail.

dsh plugin --profile web add dsh-hyprland

Restart dsh web. The 25 tools and the hyprland-control skill appear in every new session.

Requirements

NeedWhy
Hyprland 0.57+ with the Lua configuration providerMutations go through hl.dsp / hl.config
A Wayland sessionThe instance signature and WAYLAND_DISPLAY are discovered automatically
grimCaptures
wl-copy / wl-pasteClipboard and non-ASCII typing
python3 + gi.repository.AtspiThe accessibility bridge
Firefox 140+Only for hypr_browser (the Remote Agent)

No font, OCR or screenshot storage is required. The plugin writes nothing outside ~/.cache/dsh-hyprland.


Configuration

Every option is optional; defaults are defined in lib/core/config.js.

hyprland:
  capture: { format: jpeg, quality: 80, scale: 1, keepFiles: 50 }
  viewer:  { enabled: true, fps: 5, scale: 0.5 }
  a11y:    { enabled: true, allowWrite: true, allowRelaunch: true, autoEnable: true, python: python3 }
  browser: { enabled: true, port: 9222, allowEval: true, allowRestart: true }
  perf:    { stateCacheMs: 150, captureCacheMs: 200, rssWarnMb: 120 }
  dryRun: false
  safety:
    allowExit: false        # the five gates below are the only things off by default
    allowKill: false
    allowUnlock: false
    allowPower: false
    allowBulkSelect: false

browser.allowEval is on: hypr_browser { action: "evaluate" } works with no configuration.


Safety

  • A control labelled delete / remove / clear / reset / uninstall / log out is refused without confirm: true — the pointer never moves, and the history records the refusal with a text snapshot.
  • hypr_browser clicks are verified by a DOM mutation or a state change; fill reads the value back; a stale element id returns STALE_ELEMENT with candidates instead of clicking where the button was.
  • Select-all on a table with more than one row is refused by default (safety.allowBulkSelect).
  • Exiting Hyprland, SIGKILLing a window, clearing a live lock screen and power actions each need a gate.
  • Runtime changes are recorded in a durable ledger and restored after a crash or restart; nothing is ever written to ~/.config/hypr.

Performance

Measured with scripts/bench.mjs on Hyprland 0.57.2 (eDP-1 1920×1080 @ scale 1.25); ranges reflect page size and cache warmth.

OperationMedian
hypr_state summary4–5 ms
hypr_browser text / find / tables (DOM)4–160 ms
hypr_a11y find (was 588–914 ms before the bridge rewrite)31–210 ms
hypr_a11y text35–160 ms
hypr_clipboard get2–4 ms
hypr_capture / hypr_look490–860 ms (grim + encode)
Accessibility bridge RSS36 MiB

Verification

Five suites, all green. Nothing in them is mocked: they run against the live compositor and a real Firefox.

SuiteCovers
node --test test/155 unit tests: config defaults, state cache, change feed, element registry, action log, BiDi transport, mozLz4, DOM selectors, key tables, Wayland encodings
scripts/smoke.mjs14 read-only connectivity checks
scripts/acceptance.mjs49 scenarios on real GTK / Qt windows, including safety refusals
scripts/live-verify.mjs41 strict scenarios, each re-read from the compositor
scripts/full-verify.mjs42 per-tool checks, both directions
scripts/browser-verify.mjs22 page-bridge scenarios against a bundled fixture

Architecture

lib/core/      errors, config, state cache, change feed, element registry, action log, clipboard, device note
lib/hypr/      S1 requests, S2 events, instance discovery, Lua dispatch, state reads, key/text injection, recover
lib/wayland/   virtual pointer protocol
lib/a11y/      resident AT-SPI bridge (python), sessions, actions
lib/browser/   Firefox Remote Agent: BiDi transport, page session, DOM helper, sessionstore, enable
lib/safety/    destructive-action and bulk-select classification
lib/desktop/   domain capabilities: act, keys, shell, capture, look, overview, pixel
lib/tools/     the 25 tool definitions
lib/read.js    cross-domain read model (DOM first, AT-SPI fallback)
lib/service.js composition root · lib/index.js plugin entry

Dependencies point one way only: core → hypr / wayland / a11y / browser / safety → desktop → tools. lib/core/ imports nothing above itself.


Documentation

  • docs/llms.txt — the entry point for an assistant: where every answer lives
  • docs/index.md — the map: which file answers which question
  • docs/tools.md — every tool: actions, all parameters with types and defaults, returns, refusals
  • docs/modules.md — the layers, every module's exports and dependencies, "where does X live"
  • docs/symbols.md — every exported symbol to its file, and back
  • docs/errors.md — every error code: what it means and what to do
  • docs/developers.md — invariants with check commands, every configuration default, how to add a tool
  • docs/marketplace.md — how the listing works, versioning, and the release flow
  • CHANGELOG.md — releases, and what changed in each
  • docs/index.json — the same indexes as data, for a program

Author

葛墨林 Blog — https://libregml.github.io Configuration reference — https://github.com/LibreGML/ArchConfig

License

GPL-3.0-only. See LICENSE.

Related plugins