mdctl capture
Capture the live layout into a group.
mdctl capture [name] Arguments
| Argument | Type | Required | Meaning |
|---|---|---|---|
| name | string | No | The group to write into. Omit to write into the active group. |
What it prints
One line naming the group that was written.
Reads the arrangement the machine is in right now and writes it into a group: where each display sits, what mode it is in, and which one is main.
mdctl capture
Captured the layout into "Home". With no name it writes into the active group, which is the common case: you dragged a display in System Settings and want the group to remember it. With a name it writes into that group instead.
mdctl capture Office
Captured the layout into "Office". What it does not change
Capture does not add displays to a group or remove them. Membership is something you decide in the window; the arrangement is something the machine can observe.
That distinction was learned the hard way. Background auto-capture once shared this command’s code, and a rolled-back activation reached it: a single-display group came back holding both attached panels, with connected displays turned on, and nothing announced it. Adopting every panel is right when you asked for it and destructive when you did not.
Exit codes
The same four across every command, so a script can branch on the number without knowing which command produced it.
| Code | Name | When |
|---|---|---|
| 0 | ok | The command succeeded. |
| 1 | commandFailed | The app understood the command and refused or failed it. The reason is on stderr. |
| 2 | usage | The arguments were wrong. Nothing was sent. |
| 3 | appNotRunning | No app is listening on the socket. |