1
0
Fork 0
forked from wry/wry

virtual-output: add support for virtual outputs

This commit is contained in:
Julian Orth 2026-03-17 18:42:49 +01:00
parent c25d17514d
commit 530e66ef78
27 changed files with 1480 additions and 9 deletions

View file

@ -574,6 +574,40 @@
"type",
"name"
]
},
{
"description": "Creates a virtual output.\n\nThis is a no-op if a virtual output with that name already exists.\n\nThe virtual output has the connector name `VO-{name}` and the serial number\n`{name}`.\n\nA newly created connector is initially disabled. When a connector is destroyed\nand later recreated, its previous state is restored.\n\n- Example:\n\n ```toml\n [shortcuts]\n alt-x = { type = \"create-virtual-output\", name = \"abcd\" }\n\n [[connectors]]\n match.name = \"VO-abcd\"\n enabled = true\n\n [[outputs]]\n match.connector = \"VO-abcd\"\n mode = { width = 1920, height = 1080, refresh-rate = 120.0 }\n ```\n",
"type": "object",
"properties": {
"type": {
"const": "create-virtual-output"
},
"name": {
"type": "string",
"description": "The name of the output."
}
},
"required": [
"type",
"name"
]
},
{
"description": "Removes a virtual output.\n\nThis is a no-op if no virtual output with that name exists.\n",
"type": "object",
"properties": {
"type": {
"const": "remove-virtual-output"
},
"name": {
"type": "string",
"description": "The name of the output."
}
},
"required": [
"type",
"name"
]
}
]
}

View file

@ -840,6 +840,55 @@ This table is a tagged union. The variant is determined by the `type` field. It
The value of this field should be a string.
- `create-virtual-output`:
Creates a virtual output.
This is a no-op if a virtual output with that name already exists.
The virtual output has the connector name `VO-{name}` and the serial number
`{name}`.
A newly created connector is initially disabled. When a connector is destroyed
and later recreated, its previous state is restored.
- Example:
```toml
[shortcuts]
alt-x = { type = "create-virtual-output", name = "abcd" }
[[connectors]]
match.name = "VO-abcd"
enabled = true
[[outputs]]
match.connector = "VO-abcd"
mode = { width = 1920, height = 1080, refresh-rate = 120.0 }
```
The table has the following fields:
- `name` (required):
The name of the output.
The value of this field should be a string.
- `remove-virtual-output`:
Removes a virtual output.
This is a no-op if no virtual output with that name exists.
The table has the following fields:
- `name` (required):
The name of the output.
The value of this field should be a string.
<a name="types-BarPosition"></a>
### `BarPosition`

View file

@ -810,6 +810,47 @@ Action:
description: The name of the mode.
required: true
kind: string
create-virtual-output:
description: |
Creates a virtual output.
This is a no-op if a virtual output with that name already exists.
The virtual output has the connector name `VO-{name}` and the serial number
`{name}`.
A newly created connector is initially disabled. When a connector is destroyed
and later recreated, its previous state is restored.
- Example:
```toml
[shortcuts]
alt-x = { type = "create-virtual-output", name = "abcd" }
[[connectors]]
match.name = "VO-abcd"
enabled = true
[[outputs]]
match.connector = "VO-abcd"
mode = { width = 1920, height = 1080, refresh-rate = 120.0 }
```
fields:
name:
description: The name of the output.
required: true
kind: string
remove-virtual-output:
description: |
Removes a virtual output.
This is a no-op if no virtual output with that name exists.
fields:
name:
description: The name of the output.
required: true
kind: string
Exec: