1
0
Fork 0
forked from wry/wry

config: add window-rule infrastructure

This commit is contained in:
Julian Orth 2025-05-01 17:49:21 +02:00
parent a6257910bb
commit 59f8acdfde
26 changed files with 1829 additions and 38 deletions

View file

@ -858,6 +858,14 @@
"description": "",
"$ref": "#/$defs/ClientRule"
}
},
"windows": {
"type": "array",
"description": "An array of window rules.\n\nThese rules can be used to give names to windows and to manipulate them.\n\n- Example:\n\n ```toml\n [[windows]]\n name = \"spotify\"\n match.title-regex = \"Spotify\"\n action = { type = \"move-to-workspace\", name = \"music\" }\n ```\n",
"items": {
"description": "",
"$ref": "#/$defs/WindowRule"
}
}
},
"required": []
@ -1487,7 +1495,7 @@
},
"SimpleActionName": {
"type": "string",
"description": "The name of a `simple` Action.\n\n- Example:\n\n ```toml\n [shortcuts]\n alt-q = \"quit\"\n ```\n",
"description": "The name of a `simple` Action.\n\nWhen used inside a window rule, the following actions apply to the matched window\ninstead fo the focused window:\n\n- `move-left`\n- `move-down`\n- `move-up`\n- `move-right`\n- `split-horizontal`\n- `split-vertical`\n- `toggle-split`\n- `tile-horizontal`\n- `tile-vertical`\n- `toggle-split`\n- `show-single`\n- `show-all`\n- `toggle-fullscreen`\n- `enter-fullscreen`\n- `exit-fullscreen`\n- `close`\n- `toggle-floating`\n- `float`\n- `tile`\n- `toggle-float-pinned`\n- `pin-float`\n- `unpin-float`\n\n\n- Example:\n\n ```toml\n [shortcuts]\n alt-q = \"quit\"\n ```\n",
"enum": [
"focus-left",
"focus-down",
@ -1732,6 +1740,115 @@
"variant3"
]
},
"WindowMatch": {
"description": "Criteria for matching windows.\n\nIf no fields are set, all windows are matched. If multiple fields are set, all fields\nmust match the window.\n",
"type": "object",
"properties": {
"name": {
"type": "string",
"description": "Matches if the window rule with this name matches.\n\n- Example:\n\n ```toml\n [[windows]]\n name = \"spotify\"\n match.title-regex = \"Spotify\"\n\n # Matches the same windows as the previous rule.\n [[windows]]\n match.name = \"spotify\"\n ```\n"
},
"not": {
"description": "Matches if the contained criteria don't match.\n\n- Example:\n\n ```toml\n [[windows]]\n name = \"not-spotify\"\n match.not.title-regex = \"Spotify\"\n ```\n",
"$ref": "#/$defs/WindowMatch"
},
"all": {
"type": "array",
"description": "Matches if all of the contained criteria match.\n\n- Example:\n\n ```toml\n [[windows]]\n match.all = [\n { title-regex = \"Spotify\" },\n { title-regex = \"Premium\" },\n ]\n ```\n",
"items": {
"description": "",
"$ref": "#/$defs/WindowMatch"
}
},
"any": {
"type": "array",
"description": "Matches if any of the contained criteria match.\n\n- Example:\n\n ```toml\n [[windows]]\n match.any = [\n { title-regex = \"Spotify\" },\n { title-regex = \"Alacritty\" },\n ]\n ```\n",
"items": {
"description": "",
"$ref": "#/$defs/WindowMatch"
}
},
"exactly": {
"description": "Matches if a specific number of contained criteria match.\n\n- Example:\n\n ```toml\n # Matches any window that is either Alacritty or on workspace 3 but not both.\n [[windows]]\n match.exactly.num = 1\n match.exactly.list = [\n { workspace = \"3\" },\n { title-regex = \"Alacritty\" },\n ]\n ```\n",
"$ref": "#/$defs/WindowMatchExactly"
},
"types": {
"description": "Matches windows whose type is contained in the mask.",
"$ref": "#/$defs/WindowTypeMask"
}
},
"required": []
},
"WindowMatchExactly": {
"description": "Criterion for matching a specific number of window criteria.\n",
"type": "object",
"properties": {
"num": {
"type": "number",
"description": "The number of criteria that must match."
},
"list": {
"type": "array",
"description": "The list of criteria.",
"items": {
"description": "",
"$ref": "#/$defs/WindowMatch"
}
}
},
"required": [
"num",
"list"
]
},
"WindowRule": {
"description": "A window rule.\n",
"type": "object",
"properties": {
"name": {
"type": "string",
"description": "The name of this rule.\n\nThis name can be referenced in other rules.\n\n- Example\n\n ```toml\n [[windows]]\n name = \"spotify\"\n match.title-regex = \"Spotify\"\n\n [[windows]]\n match.name = \"spotify\"\n action = \"enter-fullscreen\"\n ```\n"
},
"match": {
"description": "The criteria that select the window that this rule applies to.",
"$ref": "#/$defs/WindowMatch"
},
"action": {
"description": "An action to execute when a window matches the criteria.",
"$ref": "#/$defs/Action"
},
"latch": {
"description": "An action to execute when a window no longer matches the criteria.",
"$ref": "#/$defs/Action"
}
},
"required": []
},
"WindowTypeMask": {
"description": "A mask of window types.\n",
"anyOf": [
{
"type": "string",
"description": "A named mask.",
"enum": [
"none",
"any",
"container",
"xdg-toplevel",
"x-window",
"client-window"
]
},
{
"type": "array",
"description": "An array of masks that are OR'd.",
"items": {
"description": "",
"$ref": "#/$defs/WindowTypeMask"
}
}
]
},
"XScalingMode": {
"type": "string",
"description": "The scaling mode of X windows.\n\n- Example:\n\n ```toml\n xwayland = { scaling-mode = \"downscaled\" }\n ```\n",