Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add IPC server and CLI #350

Merged
merged 70 commits into from
Aug 6, 2023
Merged

feat: add IPC server and CLI #350

merged 70 commits into from
Aug 6, 2023

Conversation

lars-berger
Copy link
Member

@lars-berger lars-berger commented Aug 5, 2023

IPC support

Add a Websocket IPC server. The server runs on port 6123 and responds with camel-case JSON. This makes it possible for other applications to query GlazeWM's state and run WM commands.

Add the following commands:

# List all monitors.
# eg. [{ deviceName: 'DISPLAY1', id: "xx", ... }]
monitors

# List all active workspaces.
# eg. [{ name: '1', id: "xx", ... }]
workspaces

# List all windows.
# eg. [{ handle: 10041, id: "xx", ... }]
windows

# Run a WM command. Wrap the command to run in double-quotes.
command "focus workspace 1" 

# Run a WM command with a specific context container. This way we can target the
# container to operate on. If no context container is specified, it defaults to the
# currently focused container.
command "move left" --context-container-id <ID_OF_CONTAINER>
command "move left" -c <ID_OF_CONTAINER>

# Subscribe to a WM event(s).
subscribe --events window_focused,workspace_activated
subscribe -e window_focused,workspace_activated

CLI support

Add CLI support. The same commands that are supported by the IPC server are supported by the CLI. Interally, the CLI simply connects to the Websocket server and forwards the command.

./GlazeWM.exe workspaces 

Misc

  • Major changes to the project structure. Entry point is now GlazeWM.App instead of GlazeWM.Bootstrapper. The CLI, window manager, and IPC server are projects under the GlazeWM.App namespace (eg. GlazeWM.App.Cli).
  • Fix invalid XAML in ComponentPortal after merge.
  • Changes to how containers are serialized to JSON.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant