Layout management: CRUD, screen and virtual-desktop assignments, quick layout slots (1-9), KDE Activities, and editor launch.
| Well-known name | org.plasmazones.LayoutRegistry |
| Source XML | org.plasmazones.LayoutRegistry.xml |
| Methods | 62 |
| Signals | 14 |
| Properties | 0 |
Returns the settings-based DEFAULT layout as JSON (id, name, zones, etc.). Note this is the persisted default, which may differ from the transient internal active layout — subscribe to activeLayoutIdChanged for the latter.
| Arg | Direction | Type | Description |
|---|---|---|---|
layoutJson | out | s *(string)* | Full layout as JSON (id, name, zones, etc.). |
Returns an array of strings; each element is one JSON-serialized layout object (manual layouts enriched with origin/visibility/allow-lists, plus autotile algorithm entries). Never bare IDs and never a single JSON array.
| Arg | Direction | Type | Description |
|---|---|---|---|
layouts | out | as *(array<string>)* | Array of JSON-serialized layout objects, one per string. |
Source-agnostic list of renderer-ready previews across manual zone layouts and autotile algorithms. Each entry is a PhosphorLayout::LayoutPreview serialised to JSON (id, displayName, zones[]{x,y,width,height}, isAutotile, optional algorithm{...} metadata for autotile entries). Renderers consume uniformly without branching on the underlying source. Returns '[]' when no source is wired (early startup).
| Arg | Direction | Type | Description |
|---|---|---|---|
previewListJson | out | s *(string)* | JSON array of LayoutPreview objects. |
Source-agnostic preview for a single entry. id must match one returned by getLayoutPreviewList. windowCount is honoured by autotile sources (algorithm runs at that count); manual sources ignore it. Returns '{}' when id is unknown or no source is wired.
| Arg | Direction | Type | Description |
|---|---|---|---|
id | in | s *(string)* | Preview id (manual layout UUID with braces, or 'autotile:<algorithmId>'). |
windowCount | in | i *(int32)* | Window count to render autotile algorithms with. Ignored by manual sources. |
previewJson | out | s *(string)* | LayoutPreview serialised to JSON, or '{}' if not found. |
Returns a specific layout by ID as JSON. Empty string if not found.
| Arg | Direction | Type | Description |
|---|---|---|---|
id | in | s *(string)* | Layout UUID. |
layoutJson | out | s *(string)* | Full layout as JSON, or empty if not found. |
Switch to the layout with the given UUID.
| Arg | Direction | Type | Description |
|---|---|---|---|
id | in | s *(string)* | Layout UUID to activate. |
Apply quick layout slot (1-9) for the given mode to the given screen.
| Arg | Direction | Type | Description |
|---|---|---|---|
mode | in | i *(int32)* | Tiling mode (0 = snapping, 1 = autotile). |
number | in | i *(int32)* | Slot number (1-9). |
screenId | in | s *(string)* | Target screen name (e.g. DP-1). |
Create a new empty layout. Returns the new layout UUID.
| Arg | Direction | Type | Description |
|---|---|---|---|
name | in | s *(string)* | Display name for the layout. |
type | in | s *(string)* | Layout type (e.g. custom). |
layoutId | out | s *(string)* | UUID of the created layout. |
Permanently delete the layout with the given ID.
| Arg | Direction | Type | Description |
|---|---|---|---|
id | in | s *(string)* | Layout UUID to delete. |
Create a copy of an existing layout. Returns the new layout UUID.
| Arg | Direction | Type | Description |
|---|---|---|---|
id | in | s *(string)* | Layout UUID to duplicate. |
layoutId | out | s *(string)* | UUID of the new layout copy. |
Import a layout from a JSON file. Returns the imported layout UUID.
| Arg | Direction | Type | Description |
|---|---|---|---|
filePath | in | s *(string)* | Absolute path to the JSON file. |
layoutId | out | s *(string)* | UUID of the imported layout. |
Export a layout to a JSON file at the given path.
| Arg | Direction | Type | Description |
|---|---|---|---|
layoutId | in | s *(string)* | Layout UUID to export. |
filePath | in | s *(string)* | Destination file path. |
Set whether a layout is hidden from the zone selector.
| Arg | Direction | Type | Description |
|---|---|---|---|
layoutId | in | s *(string)* | Layout UUID. |
hidden | in | b *(bool)* | True to hide from zone selector. |
Set whether a layout auto-assigns new windows to empty zones.
| Arg | Direction | Type | Description |
|---|---|---|---|
layoutId | in | s *(string)* | Layout UUID. |
enabled | in | b *(bool)* | True to enable auto-assign. |
Set a layout's aspect-ratio class (which monitor shapes it targets).
| Arg | Direction | Type | Description |
|---|---|---|---|
layoutId | in | s *(string)* | Layout UUID. |
aspectRatioClass | in | i *(int32)* | Aspect-ratio class enum value. |
Replace an existing layout with the supplied full layout JSON (editor save path). The layout's UUID is taken from the JSON.
| Arg | Direction | Type | Description |
|---|---|---|---|
layoutJson | in | s *(string)* | Full layout as JSON. |
success | out | b *(bool)* | True if the layout was updated. |
Create a new layout from the supplied full layout JSON (editor new-layout save, KZones import).
| Arg | Direction | Type | Description |
|---|---|---|---|
layoutJson | in | s *(string)* | Full layout as JSON. |
layoutId | out | s *(string)* | UUID of the created layout, or empty string on failure. |
Launch the layout editor for the active layout.
No arguments.
Launch the layout editor for the layout assigned to the given screen.
| Arg | Direction | Type | Description |
|---|---|---|---|
screenId | in | s *(string)* | Screen to edit layout for (e.g. DP-1). |
Launch the layout editor for a specific layout, optionally targeting a screen for geometry/name matching.
| Arg | Direction | Type | Description |
|---|---|---|---|
layoutId | in | s *(string)* | Layout UUID to edit. |
screenId | in | s *(string)* | Screen to open on (empty = editor default). |
Return current mode, layout, and algorithm for all screens as a JSON array: one object per screen with screenId, virtualDesktop, activity, mode (0=Snapping, 1=Autotile), layoutId, layoutName, algorithmId, algorithmName.
| Arg | Direction | Type | Description |
|---|---|---|---|
statesJson | out | s *(string)* | JSON array of per-screen state objects. |
Get the layout currently in use on a screen (resolves with current virtual desktop and activity context).
| Arg | Direction | Type | Description |
|---|---|---|---|
screenId | in | s *(string)* | Screen name (e.g. DP-1). |
layoutId | out | s *(string)* | Layout UUID or empty string. |
Assign a layout to a screen for all virtual desktops.
| Arg | Direction | Type | Description |
|---|---|---|---|
screenId | in | s *(string)* | Target screen name. |
layoutId | in | s *(string)* | Layout UUID to assign. |
Remove the layout assignment from a screen.
| Arg | Direction | Type | Description |
|---|---|---|---|
screenId | in | s *(string)* | Screen to clear assignment for. |
Batch set all base screen assignments (saves once). Clears existing base assignments first.
| Arg | Direction | Type | Description |
|---|---|---|---|
assignments | in | a{sv} *(dict<string,variant>)* | Map of screenId to layoutId. |
Get layout for a specific screen and virtual desktop (1-based).
| Arg | Direction | Type | Description |
|---|---|---|---|
screenId | in | s *(string)* | Screen name (e.g. DP-1). |
virtualDesktop | in | i *(int32)* | Virtual desktop index (1-based). |
layoutId | out | s *(string)* | Layout UUID or empty string. |
Assign layout to a specific screen and virtual desktop.
| Arg | Direction | Type | Description |
|---|---|---|---|
screenId | in | s *(string)* | Target screen name. |
virtualDesktop | in | i *(int32)* | Virtual desktop index (1-based). |
layoutId | in | s *(string)* | Layout UUID to assign. |
Clear layout assignment for a screen/desktop combination.
| Arg | Direction | Type | Description |
|---|---|---|---|
screenId | in | s *(string)* | Screen name. |
virtualDesktop | in | i *(int32)* | Virtual desktop index (1-based). |
True if there is an explicit assignment (not inherited) for this screen/desktop.
| Arg | Direction | Type | Description |
|---|---|---|---|
screenId | in | s *(string)* | Screen name. |
virtualDesktop | in | i *(int32)* | Virtual desktop index (1-based). |
hasAssignment | out | b *(bool)* | True if explicit assignment exists. |
Get the current mode (0=Snapping, 1=Autotile) for a screen/desktop.
| Arg | Direction | Type | Description |
|---|---|---|---|
screenId | in | s *(string)* | |
virtualDesktop | in | i *(int32)* | |
mode | out | i *(int32)* |
Get the snapping layout UUID for a screen/desktop (regardless of current mode).
| Arg | Direction | Type | Description |
|---|---|---|---|
screenId | in | s *(string)* | |
virtualDesktop | in | i *(int32)* | |
layoutId | out | s *(string)* |
Get the tiling algorithm ID for a screen/desktop (regardless of current mode).
| Arg | Direction | Type | Description |
|---|---|---|---|
screenId | in | s *(string)* | |
virtualDesktop | in | i *(int32)* | |
algorithm | out | s *(string)* |
Batch set all per-desktop assignments (saves once). Canonical key format: 'screenId|desktopNumber' ('screenId:desktopNumber' is accepted as a legacy fallback but misparses virtual-screen ids — do not emit it).
| Arg | Direction | Type | Description | |--—|--------—|---—|----------—| | assignments | in | a{sv} *(dict<string,variant>)* | Map of 'screenId|desktop' keys to layoutId. |
Get all per-desktop assignments.
| Arg | Direction | Type | Description | |--—|--------—|---—|----------—| | assignments | out | a{sv} *(dict<string,variant>)* | Map of 'screenId|desktop' keys to layoutId. |
Returns the number of virtual desktops.
| Arg | Direction | Type | Description |
|---|---|---|---|
count | out | i *(int32)* | Number of virtual desktops. |
Returns the names of all virtual desktops.
| Arg | Direction | Type | Description |
|---|---|---|---|
names | out | as *(array<string>)* | Array of desktop names. |
Returns the daemon's effective screen ids — one entry per physical monitor PLUS any virtual-screen subdivisions configured on top. Use this for screen enumeration in UI / settings panels; getAllScreenAssignments is the assignment-state readback and emits only screens with stored entries.
| Arg | Direction | Type | Description |
|---|---|---|---|
screenIds | out | as *(array<string>)* | Stable screen ids in manufacturer:model:serial form (e.g. 'Dell:U2722D:115107' for physical, 'Dell:U2722D:115107/vs:0' for virtual subdivisions). Order follows the daemon's effective-screen iteration. |
Returns all screen-to-layout assignments as JSON. The JSON is a view of stored assignment state (suitable for round-trip back through setAllScreenAssignments) — synthesized level-1 global-default fallbacks are deliberately NOT serialized, so callers that need the resolved mode for an unconfigured screen must use the per-context lookup methods instead. Only screens with at least one stored entry (base or per-desktop) appear; for screen enumeration use getAvailableScreenIds.
| Arg | Direction | Type | Description |
|---|---|---|---|
assignmentsJson | out | s *(string)* | JSON object keyed by connector name, containing one entry per screen with stored assignments. Each entry includes {"screenId": <stable-id>}. Screens with an explicit base-level assignment additionally include {"default", "snappingLayout", "tilingAlgorithm", "mode"}; screens with explicit per-desktop assignments include numeric-string keys ("1", "2", …) mapping to the assigned layout id. Screens with no stored entries are omitted entirely — DO NOT use this method to enumerate available screens; call getAvailableScreenIds instead. |
Get the layout ID assigned to a quick slot (1-9) for the given mode.
| Arg | Direction | Type | Description |
|---|---|---|---|
mode | in | i *(int32)* | Tiling mode (0 = snapping, 1 = autotile). |
slotNumber | in | i *(int32)* | Slot number (1-9). |
layoutId | out | s *(string)* | Layout UUID or empty string. |
Assign a layout to a quick slot (1-9) for the given mode.
| Arg | Direction | Type | Description |
|---|---|---|---|
mode | in | i *(int32)* | Tiling mode (0 = snapping, 1 = autotile). |
slotNumber | in | i *(int32)* | Slot number (1-9). |
layoutId | in | s *(string)* | Layout UUID to assign (empty to clear). |
Batch set all quick layout slots for the given mode (saves once).
| Arg | Direction | Type | Description |
|---|---|---|---|
mode | in | i *(int32)* | Tiling mode (0 = snapping, 1 = autotile). |
slots | in | a{sv} *(dict<string,variant>)* | Map of slot number (as string) to layoutId. |
Get all quick layout slot assignments for the given mode.
| Arg | Direction | Type | Description |
|---|---|---|---|
mode | in | i *(int32)* | Tiling mode (0 = snapping, 1 = autotile). |
slots | out | a{sv} *(dict<string,variant>)* | Map of slot number (as string) to layoutId. |
Get the current virtual desktop number (1-indexed). Returns 0 if unavailable.
| Arg | Direction | Type | Description |
|---|---|---|---|
desktop | out | i *(int32)* | Current virtual desktop number (1-based), or 0 if unavailable. |
True if KDE Activities are available.
| Arg | Direction | Type | Description |
|---|---|---|---|
available | out | b *(bool)* | True if Activities are available. |
Returns the list of activity IDs.
| Arg | Direction | Type | Description |
|---|---|---|---|
activityIds | out | as *(array<string>)* | List of activity IDs. |
Returns the current activity ID.
| Arg | Direction | Type | Description |
|---|---|---|---|
activityId | out | s *(string)* | Current activity ID. |
Returns activity metadata as JSON for the given activity ID.
| Arg | Direction | Type | Description |
|---|---|---|---|
activityId | in | s *(string)* | Activity ID to query. |
activityJson | out | s *(string)* | Activity metadata as JSON. |
Returns metadata for all activities as JSON.
| Arg | Direction | Type | Description |
|---|---|---|---|
activitiesJson | out | s *(string)* | All activities metadata as JSON. |
Get layout for a screen and activity (any desktop).
| Arg | Direction | Type | Description |
|---|---|---|---|
screenId | in | s *(string)* | Screen name (e.g. DP-1). |
activityId | in | s *(string)* | KDE Activity ID. |
layoutId | out | s *(string)* | Layout UUID or empty string. |
Assign layout to a screen and activity.
| Arg | Direction | Type | Description |
|---|---|---|---|
screenId | in | s *(string)* | Target screen name. |
activityId | in | s *(string)* | KDE Activity ID. |
layoutId | in | s *(string)* | Layout UUID to assign. |
Clear layout assignment for a screen/activity combination.
| Arg | Direction | Type | Description |
|---|---|---|---|
screenId | in | s *(string)* | Screen name. |
activityId | in | s *(string)* | KDE Activity ID. |
True if there is an explicit assignment for this screen/activity.
| Arg | Direction | Type | Description |
|---|---|---|---|
screenId | in | s *(string)* | Screen name. |
activityId | in | s *(string)* | KDE Activity ID. |
hasAssignment | out | b *(bool)* | True if explicit assignment exists. |
Batch set all per-activity assignments (saves once). Key format: 'screenId|activityId' (legacy ':' fallback accepted).
| Arg | Direction | Type | Description | |--—|--------—|---—|----------—| | assignments | in | a{sv} *(dict<string,variant>)* | Map of 'screenId|activityId' keys to layoutId. |
Get all per-activity assignments.
| Arg | Direction | Type | Description | |--—|--------—|---—|----------—| | assignments | out | a{sv} *(dict<string,variant>)* | Map of 'screenId|activityId' keys to layoutId. |
Batch set all per-(screen,desktop,activity) Combined assignments (saves once). Key format: 'screenId|virtualDesktop|activityId'. Pure-Activity, pure-Desktop and Monitor-only rules are not touched.
| Arg | Direction | Type | Description | |--—|--------—|---—|----------—| | assignments | in | a{sv} *(dict<string,variant>)* | Map of 'screen|desktop|activity' to layoutId. |
Get all per-(screen,desktop,activity) Combined assignments. Returns ONLY rules with all three dimensions pinned.
| Arg | Direction | Type | Description | |--—|--------—|---—|----------—| | assignments | out | a{sv} *(dict<string,variant>)* | Map of 'screen|desktop|activity' to layoutId. |
Get layout for screen, virtual desktop, and activity.
| Arg | Direction | Type | Description |
|---|---|---|---|
screenId | in | s *(string)* | Screen name (e.g. DP-1). |
virtualDesktop | in | i *(int32)* | Virtual desktop index (1-based). |
activityId | in | s *(string)* | KDE Activity ID. |
layoutId | out | s *(string)* | Layout UUID or empty string. |
Assign layout to screen, desktop, and activity.
| Arg | Direction | Type | Description |
|---|---|---|---|
screenId | in | s *(string)* | Target screen name. |
virtualDesktop | in | i *(int32)* | Virtual desktop index (1-based). |
activityId | in | s *(string)* | KDE Activity ID. |
layoutId | in | s *(string)* | Layout UUID to assign. |
Clear layout assignment for screen/desktop/activity.
| Arg | Direction | Type | Description |
|---|---|---|---|
screenId | in | s *(string)* | Screen name. |
virtualDesktop | in | i *(int32)* | Virtual desktop index (1-based). |
activityId | in | s *(string)* | KDE Activity ID. |
Set a complete assignment entry (mode + snapping layout + tiling algorithm) for a screen/desktop/activity context. Settings app sends one full entry per staged context during save.
| Arg | Direction | Type | Description |
|---|---|---|---|
screenId | in | s *(string)* | Screen ID. |
virtualDesktop | in | i *(int32)* | Virtual desktop index (1-based, 0 = screen-level). |
activity | in | s *(string)* | KDE Activity ID (empty = all activities). |
mode | in | i *(int32)* | Mode (0=Snapping, 1=Autotile). |
snappingLayout | in | s *(string)* | Snapping layout UUID (empty = unset). |
tilingAlgorithm | in | s *(string)* | Tiling algorithm ID (empty = unset). |
Suppress screenLayoutChanged signals while the settings app replays a batch of assignment mutations during save. Always paired: setSaveBatchMode(true) before the batch, setSaveBatchMode(false) after.
| Arg | Direction | Type | Description |
|---|---|---|---|
enabled | in | b *(bool)* | True to enter batch mode, false to leave it. |
Trigger resnap/retile + OSD after a batch of assignment changes. Settings app calls this once after all setAssignmentEntry/clear calls complete.
No arguments.
Emitted when the daemon has fully initialized and is ready. Clients (KCM, KWin effect) should wait for this before querying layouts.
No payload.
Emitted when the internal active layout changes. Carries the transient active-layout UUID, which may differ from getActiveLayout()'s settings-based default.
| Arg | Direction | Type | Description |
|---|---|---|---|
layoutId | out | s *(string)* | UUID of the newly active layout. |
Emitted when quick layout slots are modified, so the settings panel can refresh its slot assignments.
No payload.
Emitted after applyAssignmentChanges finishes a KCM save batch, listing the screens whose assignments changed.
| Arg | Direction | Type | Description |
|---|---|---|---|
changedScreenIds | out | as *(array<string>)* | Screen IDs whose assignments were modified in the batch. |
Emitted when the current KDE Activity changes.
| Arg | Direction | Type | Description |
|---|---|---|---|
activityId | out | s *(string)* | New current activity ID. |
Emitted when the list of activities changes.
No payload.
Emitted when the number of virtual desktops changes.
| Arg | Direction | Type | Description |
|---|---|---|---|
count | out | i *(int32)* | New virtual desktop count. |
Emitted on structural layout mutations (editor save, updateLayout, createLayoutFromJson). Carries the full layout JSON payload. Scalar property mutations (hidden, autoAssign, aspectRatioClass) emit layoutPropertyChanged instead to avoid the full serialization.
| Arg | Direction | Type | Description |
|---|---|---|---|
layoutJson | out | s *(string)* | Full layout as JSON. |
Cheap context-switch notification: emitted alongside layoutChanged(json) on every active-layout switch, but carries only the layout UUID instead of the full JSON payload. Subscribers that re-load from disk (e.g. the editor) can bind to this signal and ignore the heavier layoutChanged emit.
| Arg | Direction | Type | Description |
|---|---|---|---|
layoutId | out | s *(string)* | UUID of the newly active layout. |
Compact per-property change notification. Replaces layoutChanged(json) for setLayoutHidden, setLayoutAutoAssign, and setLayoutAspectRatioClass. Subscribers that want the full shape should pull it via getLayout(layoutId) — the adaptor's cache is invalidated before the signal fires.
| Arg | Direction | Type | Description |
|---|---|---|---|
layoutId | out | s *(string)* | Layout UUID whose property changed. |
property | out | s *(string)* | Property name: 'hidden', 'autoAssign', or 'aspectRatioClass'. |
value | out | v *(variant)* | New value as a variant (bool or int). |
Emitted when the list of layouts changes.
No payload.
Emitted when a new layout is created (createLayout, createLayoutFromJson, duplicateLayout, importLayout). Carries the new layout's UUID.
| Arg | Direction | Type | Description |
|---|---|---|---|
layoutId | out | s *(string)* | UUID of the newly created layout. |
Emitted when a layout is deleted. Carries the UUID of the deleted layout.
| Arg | Direction | Type | Description |
|---|---|---|---|
layoutId | out | s *(string)* | UUID of the deleted layout. |
Emitted when a screen's layout assignment changes.
| Arg | Direction | Type | Description |
|---|---|---|---|
screenId | out | s *(string)* | Screen whose assignment changed. |
layoutId | out | s *(string)* | Assigned layout UUID. |
virtualDesktop | out | i *(int32)* | Virtual desktop number (0 = display default). |