Skip to content

feat: show OmniWM workspaces in workspace widgets - #272

Merged
M4n0x merged 1 commit into
mainfrom
feat/267-omniwm-workspaces
Oct 23, 2026
Merged

M4n0x merged 1 commit into
mainfrom
feat/267-omniwm-workspaces

Conversation

@M4n0x

@M4n0x M4n0x commented Oct 23, 2026

Copy link
Copy Markdown
Collaborator

Problem

workspaceSource accepts only aerospace, yabai and spaces, so people who use OmniWM can't show their workspaces in a workspaces widget. Closes #267.

Changes

  • New omniwm source (OmniWM.swift, Workspaces.swift). StableBar runs omniwmctl from the login shell's PATH, or the copy inside OmniWM's app, so OmniWM's Install CLI to PATH is optional.
    • Snapshot: query workspaces and query windows, with --fields so OmniWM doesn't compute frames or columns on every refresh. Display IDs (display:<CGDirectDisplayID>) map to screen numbers the way yabai's do.
    • Live updates: subscribe active-workspace,focused-monitor,focus,windows-changed,layout-changed,display-changed --no-send-initial --format ndjson. It runs without --reconnect, so the stream ends when OmniWM quits. The existing AeroSpace loop then reports it, backs off and reconnects at once when OmniWM launches. The loop now reads lines and decodes them per source.
    • Clicks: workspace focus-name <raw name> and window focus <opaque id>. OmniWM's window IDs are session strings, so WorkspaceWindow gains an optional reference.
    • The focused workspace is OmniWM's isCurrent (the active workspace on the display in use), not isFocused, which is false on an empty workspace. That matches how AeroSpace reports focus.
    • Scratchpad windows aren't shown, because OmniWM's own bar lists them separately.
    • Errors: omniwmctl prints a JSON error with a non-zero exit. A connection failure becomes "Can't reach OmniWM. Check that it's running and that Enable IPC is on in its menu." no_change (clicking the current workspace) counts as success.
  • Display names. Workspace gains an optional displayName, and cells, help, accessibility labels and the bar menu show label. Only OmniWM sets it; the other sources look the same as before.
  • Other surfaces. The schema enum, the Settings → General picker and gap hint, setup's detection (WorkspaceSource.detected) and its gaps.outer.top advice, the Settings search keywords, the Add widget description, and the triage facts and playbook (.github/triage/PLAYBOOK.md and its copy in Triage.swift).
  • Docs. A new "OmniWM workspaces" section in docs/widgets.md, and OmniWM in getting started (with the gap value: OmniWM measures gaps.outer.top from the display's top edge, so it's the panel height plus bar.offset), configuration, layout, packages and the README.

Testing

  • New tests: snapshot decoding (display mapping, display names, current workspace, scratchpad and unassigned windows, bundle ID fallback), clicks (arguments, no_change is success, not_found reads as "OmniWM: not_found"), the subscription refreshing on events, a connection failure giving the Enable IPC message, setup detection, and display names widening the cell. Each new test failed before the code existed: most at compile time, the display-name test on its assertion.
  • swift test: 285 XCTest tests pass. Of 428 Swift Testing tests, only popupResizesWithItsContentAndKeepsItsWidthAndTopEdge (animated case) fails, and it fails with the same 5 issues on main (41ed84d) on this Mac.
  • StableBar --validate accepts "workspaceSource": "omniwm" and rejects unknown values.
  • The JSON shapes, field names, exit codes and error output come from OmniWM's source and CLI reference (v0.7.6 and main).
  • Not checked: a real OmniWM. It isn't installed here, and installing a window manager on this Mac would take over its windows. Everything else was checked against a fake omniwmctl that returns OmniWM's documented output.

Settings → General, rendered offscreen with a fake omniwmctl (before: main, after: this branch with OmniWM selected):

Before After

A workspace widget with "windows": true, fed from the fake omniwmctl through the subscription, queries and decoding. "Web" and "Code" are OmniWM display names; workspace 3 has none.

Merging

One feat commit, so a squash merge with this title works too. It starts a minor release.

Claude Opus 5.5 via Claude Code

Add an omniwm workspace source. StableBar runs omniwmctl from the login shell's PATH or from
OmniWM's app: it queries workspaces and windows, subscribes to workspace, window, focus and
display changes, and focuses a workspace or window on click. Cells show OmniWM's display
names, and the focused workspace is the active one on the display in use, even when empty.
Failures say how to reach OmniWM, such as turning on Enable IPC.

Setup detects OmniWM and gives its gap advice, Settings offers it as a workspace manager, and
the guide documents it.

Closes #267
@M4n0x
M4n0x requested a review from Seb-GRAF as a code owner October 23, 2026 09:42
@M4n0x
M4n0x merged commit 5a5ad25 into main Oct 23, 2026
7 checks passed
@M4n0x
M4n0x deleted the feat/267-omniwm-workspaces branch October 23, 2026 09:48
@stablebar-releases

Copy link
Copy Markdown

🎉 This PR is included in version 0.7.0 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Show OmniWM workspaces in workspace widgets

1 participant