Add aerospace subscribe command for real-time event streaming#1927
Open
ojowwalker77 wants to merge 3 commits intonikitabobko:mainfrom
Open
Add aerospace subscribe command for real-time event streaming#1927ojowwalker77 wants to merge 3 commits intonikitabobko:mainfrom
aerospace subscribe command for real-time event streaming#1927ojowwalker77 wants to merge 3 commits intonikitabobko:mainfrom
Conversation
Allows external tools (status bars, scripts) to receive real-time event notifications over the existing socket protocol without modifying config. Events: focus-changed, workspace-changed, focused-monitor-changed, mode-changed, window-detected, binding-triggered Usage: aerospace subscribe [--all] [<event>...] Initial state (current focus/mode) is sent on connect. Events are streamed as JSON lines until the client disconnects. Closes nikitabobko#1514
Author
|
hey man! @nikitabobko |
nikitabobko
requested changes
Feb 2, 2026
Owner
nikitabobko
left a comment
There was a problem hiding this comment.
Hi! Thanks, I send you the first review iteration
Author
|
on it! |
nikitabobko
reviewed
Feb 2, 2026
nikitabobko
reviewed
Feb 2, 2026
nikitabobko
reviewed
Feb 2, 2026
….write Previously, header and payload were sent as two separate writes which could interleave with concurrent writes. Now they are combined into a single Data before sending.
- Subscribe to specific events: focus-changed, focused-monitor-changed, focused-workspace-changed, mode-changed, window-detected, binding-triggered - Events streamed as JSON lines over persistent socket connection - Initial state sent on connect for stateful events - Use --all flag to subscribe to all event types - Duplicate event args are rejected - ServerEvent uses static factory methods for type safety - monitorId is now 1-based (0 means unknown) in event output - Documentation and shell completion updated
nikitabobko
added a commit
that referenced
this pull request
Feb 6, 2026
Allows external tools (status bars, scripts) to receive real-time event notifications over the existing socket protocol without modifying config. Events: focus-changed, workspace-changed, focused-monitor-changed, mode-changed, window-detected, binding-triggered Initial state (current focus/mode) is sent on connect. Events are streamed as JSON lines until the client disconnects. #1514 closes #1927 Co-authored-by: Nikita Bobko <git@bobko.xyz>
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.
Closes #1514
Allows external tools (status bars, scripts) to receive real-time event notifications over the existing socket protocol without modifying config.
Events
focus-changed- window/workspace/monitor focusworkspace-changed- workspace switchesfocused-monitor-changed- monitor focusmode-changed- binding mode changeswindow-detected- new windowsbinding-triggered- keybinding executedUsage
Output (JSON lines)
{"event":"focus-changed","windowId":1234,"workspace":"1","monitorId":0} {"event":"workspace-changed","workspace":"2","prevWorkspace":"1"}Initial state (current focus/mode) is sent on connect. Tested with rapid workspace switching.