Repository navigation
feat: show OmniWM workspaces in workspace widgets - #272
Merged
Merged
Conversation
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
|
🎉 This PR is included in version 0.7.0 🎉 The release is available on GitHub release Your semantic-release bot 📦🚀 |
Closed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
workspaceSourceaccepts onlyaerospace,yabaiandspaces, so people who use OmniWM can't show their workspaces in aworkspaceswidget. Closes #267.Changes
omniwmsource (OmniWM.swift,Workspaces.swift). StableBar runsomniwmctlfrom the login shell'sPATH, or the copy inside OmniWM's app, so OmniWM's Install CLI to PATH is optional.query workspacesandquery windows, with--fieldsso OmniWM doesn't compute frames or columns on every refresh. Display IDs (display:<CGDirectDisplayID>) map to screen numbers the way yabai's do.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.workspace focus-name <raw name>andwindow focus <opaque id>. OmniWM's window IDs are session strings, soWorkspaceWindowgains an optionalreference.isCurrent(the active workspace on the display in use), notisFocused, which is false on an empty workspace. That matches how AeroSpace reports focus.omniwmctlprints 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.Workspacegains an optionaldisplayName, and cells, help, accessibility labels and the bar menu showlabel. Only OmniWM sets it; the other sources look the same as before.WorkspaceSource.detected) and itsgaps.outer.topadvice, the Settings search keywords, the Add widget description, and the triage facts and playbook (.github/triage/PLAYBOOK.mdand its copy inTriage.swift).docs/widgets.md, and OmniWM in getting started (with the gap value: OmniWM measuresgaps.outer.topfrom the display's top edge, so it's the panel height plusbar.offset), configuration, layout, packages and the README.Testing
no_changeis success,not_foundreads 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, onlypopupResizesWithItsContentAndKeepsItsWidthAndTopEdge(animated case) fails, and it fails with the same 5 issues onmain(41ed84d) on this Mac.StableBar --validateaccepts"workspaceSource": "omniwm"and rejects unknown values.main).omniwmctlthat returns OmniWM's documented output.Settings → General, rendered offscreen with a fake
omniwmctl(before:main, after: this branch with OmniWM selected):A workspace widget with
"windows": true, fed from the fakeomniwmctlthrough the subscription, queries and decoding. "Web" and "Code" are OmniWM display names; workspace 3 has none.Merging
One
featcommit, so a squash merge with this title works too. It starts a minor release.Claude Opus 5.5 via Claude Code