1
0
Fork 0
forked from wry/wry

feat(config): Add directional output selection via separate direction field

Add support for directional output selection in the move-to-output action
using a separate `direction` field instead of overloading OutputMatch.

API additions:
- Add Workspace::connector() to get the connector showing a workspace
- Add Connector::connector_in_direction() to find outputs directionally

Implementation:
- Move directional finding logic from toml-config to compositor
- Algorithm uses center-to-center distance with axis-aligned preference
- Add GetWorkspaceConnector and GetConnectorInDirection IPC messages

Configuration changes:
- Add optional `direction` field to move-to-output action
- Either `output` or `direction` must be specified (not both)
- Valid directions: "left", "right", "up", "down"

Example usage:
  logo+control+shift+right = { type = "move-to-output", direction = "right" }

Signed-off-by: Arthur Heymans <arthur@aheymans.xyz>
This commit is contained in:
Arthur Heymans 2025-11-27 09:49:33 +01:00 committed by Julian Orth
parent e81b31b452
commit 5529306c67
13 changed files with 348 additions and 25 deletions

View file

@ -288,19 +288,29 @@ Action:
description: |
Moves a workspace to a different output.
- Example 1:
- Example 1: Move a specific workspace to a named output
```toml
[shortcuts]
alt-F1 = { type = "move-to-output", workspace = "1", output.name = "right" }
```
- Example 2:
- Example 2: Move the current workspace to a named output
```toml
[shortcuts]
alt-F1 = { type = "move-to-output", output.name = "right" }
```
- Example 3: Move the current workspace to the output on the right (directional)
```toml
[shortcuts]
"logo+ctrl+shift+Right" = { type = "move-to-output", direction = "right" }
"logo+ctrl+shift+Left" = { type = "move-to-output", direction = "left" }
"logo+ctrl+shift+Up" = { type = "move-to-output", direction = "up" }
"logo+ctrl+shift+Down" = { type = "move-to-output", direction = "down" }
```
fields:
workspace:
description: |
@ -315,8 +325,21 @@ Action:
If multiple outputs match, the workspace is moved to the first matching
output.
required: true
Either `output` or `direction` must be specified, but not both.
required: false
ref: OutputMatch
direction:
description: |
The direction to search for the next output.
Finds the closest output in the specified direction based on
center-to-center distance, with preference for outputs better aligned
with the movement axis.
Either `output` or `direction` must be specified, but not both.
required: false
ref: Direction
configure-connector:
description: |
Applies a configuration to connectors.
@ -4193,6 +4216,21 @@ BlendSpace:
description: Linear color space. This is the physically correct blend space.
Direction:
kind: string
description: |
A directional value used for output selection.
values:
- value: left
description: The left direction.
- value: right
description: The right direction.
- value: up
description: The up direction.
- value: down
description: The down direction.
ClientCapabilities:
description: |
A mask of client capabilities.