1
0
Fork 0
forked from wry/wry

feat: implement declarative scratchpads

This commit is contained in:
atagen 2026-06-03 16:51:26 +10:00
parent d756c8a6a2
commit b6502e1d8a
17 changed files with 549 additions and 78 deletions

View file

@ -289,11 +289,12 @@ This table is a tagged union. The variant is determined by the `type` field. It
- `send-to-scratchpad`:
Sends the currently focused window to a scratchpad and hides it.
If `name` is omitted, the default scratchpad is used.
A scratchpad can hold any number of windows. If `name` is omitted, the
default scratchpad is used.
- Example:
```toml
[shortcuts]
alt-shift-minus = { type = "send-to-scratchpad", name = "terminal" }
@ -310,13 +311,14 @@ This table is a tagged union. The variant is determined by the `type` field. It
- `toggle-scratchpad`:
Toggles a scratchpad.
If the scratchpad has a visible window, that window is hidden. Otherwise, the
most recently hidden window in the scratchpad is shown on the current workspace.
If `name` is omitted, the default scratchpad is used.
Only one window of a scratchpad is shown at a time, and scratchpad windows are
always shown floating. If `name` is omitted, the default scratchpad is used.
- Example:
```toml
[shortcuts]
alt-minus = { type = "toggle-scratchpad", name = "terminal" }
@ -330,6 +332,30 @@ This table is a tagged union. The variant is determined by the `type` field. It
The value of this field should be a string.
- `cycle-scratchpad`:
Cycles through the windows of a scratchpad, one at a time.
With no window shown, the first window is brought up. Each further invocation
hides the current window and shows the next; after the last window the
scratchpad is hidden again. Scratchpad windows are always shown floating.
If `name` is omitted, the default scratchpad is used.
- Example:
```toml
[shortcuts]
alt-minus = { type = "cycle-scratchpad", name = "terminal" }
```
The table has the following fields:
- `name` (optional):
The name of the scratchpad.
The value of this field should be a string.
- `move-to-output`:
Moves a workspace to a different output.
@ -1074,7 +1100,7 @@ The table has the following fields:
- `enabled` (optional):
Enables or disables window animations.
The default is `false`.
The value of this field should be a boolean.
@ -1082,7 +1108,7 @@ The table has the following fields:
- `duration-ms` (optional):
Sets the animation duration in milliseconds.
The default is `160`.
The value of this field should be a number.
@ -1092,7 +1118,7 @@ The table has the following fields:
- `style` (optional):
Sets the animation style used for tiled window movement animations.
The default is `multiphase`.
The value of this field should be a [AnimationStyle](#types-AnimationStyle).
@ -1100,7 +1126,7 @@ The table has the following fields:
- `curve` (optional):
Sets the animation curve.
The default is `ease-out`.
The value of this field should be a [AnimationCurve](#types-AnimationCurve).
@ -2336,11 +2362,11 @@ The table has the following fields:
- `animations` (optional):
Configures window animations.
Animations are disabled by default.
- Example:
```toml
[animations]
enabled = true
@ -2646,6 +2672,32 @@ The table has the following fields:
The value of this field should be a [Egui](#types-Egui).
- `scratchpads` (optional):
An array of pre-configured scratchpads.
Each entry launches a program when the graphics are first initialized and
immediately parks its window in the named scratchpad. The window is captured
via a unique tag attached to the spawned process, so other windows of the
same application are never affected.
Use a `toggle-scratchpad` or `cycle-scratchpad` action to bring the windows
up; they are always shown floating.
- Example:
```toml
[[scratchpads]]
name = "term"
exec = "foot"
[[scratchpads]]
name = "notes"
exec = ["obsidian"]
```
The value of this field should be an array of [Scratchpads](#types-Scratchpad).
<a name="types-Connector"></a>
### `Connector`
@ -4579,6 +4631,40 @@ The table has the following fields:
The value of this field should be a string.
<a name="types-Scratchpad"></a>
### `Scratchpad`
A pre-configured scratchpad whose program is launched at startup and parked
in the scratchpad.
- Example:
```toml
[[scratchpads]]
name = "term"
exec = "foot"
```
Values of this type should be tables.
The table has the following fields:
- `name` (required):
The name of the scratchpad that the spawned window is parked in.
The value of this field should be a string.
- `exec` (optional):
The program to launch when the graphics are first initialized.
If omitted, no program is launched and the scratchpad is only created on
demand by `send-to-scratchpad`.
The value of this field should be a [Exec](#types-Exec).
<a name="types-SimpleActionName"></a>
### `SimpleActionName`
@ -4702,6 +4788,10 @@ The string should have one of the following values:
Toggles the default scratchpad.
- `cycle-scratchpad`:
Cycles through the windows of the default scratchpad.
- `focus-parent`:
Focus the parent of the currently focused window.
@ -5883,3 +5973,5 @@ The table has the following fields:
The scaling mode of X windows.
The value of this field should be a [XScalingMode](#types-XScalingMode).