Phosphor
Qt6 / Wayland library suite for window-management tools
 
Loading...
Searching...
No Matches
org.plasmazones.LayoutRegistry

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 52
Signals 10
Properties 0

Methods

<tt>getActiveLayout()</tt>

Returns the currently active layout as JSON (id, name, zones, etc.).

Arg Direction Type Description
layoutJson out s *(string)* Full layout as JSON (id, name, zones, etc.).

<tt>getLayoutList()</tt>

Returns a list of all available layout IDs (or JSON array of layout objects, depending on implementation).

Arg Direction Type Description
layouts out as *(array<string>)* List of layout IDs or JSON array of layout objects.

<tt>getLayoutPreviewList()</tt>

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.

<tt>getLayoutPreview()</tt>

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.

<tt>getLayout()</tt>

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.

<tt>setActiveLayout()</tt>

Switch to the layout with the given UUID.

Arg Direction Type Description
id in s *(string)* Layout UUID to activate.

<tt>applyQuickLayout()</tt>

Apply quick layout slot (1-9) to the given screen.

Arg Direction Type Description
number in i *(int32)* Slot number (1-9).
screenName in s *(string)* Target screen name (e.g. DP-1).

<tt>createLayout()</tt>

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.

<tt>deleteLayout()</tt>

Permanently delete the layout with the given ID.

Arg Direction Type Description
id in s *(string)* Layout UUID to delete.

<tt>duplicateLayout()</tt>

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.

<tt>importLayout()</tt>

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.

<tt>exportLayout()</tt>

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.

<tt>setLayoutHidden()</tt>

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.

<tt>setLayoutAutoAssign()</tt>

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.

<tt>openEditor()</tt>

Launch the layout editor for the active layout.

No arguments.

<tt>openEditorForScreen()</tt>

Launch the layout editor for the layout assigned to the given screen.

Arg Direction Type Description
screenName in s *(string)* Screen to edit layout for (e.g. DP-1).

<tt>getLayoutForScreen()</tt>

Get the layout currently in use on a screen (resolves with current virtual desktop and activity context).

Arg Direction Type Description
screenName in s *(string)* Screen name (e.g. DP-1).
layoutId out s *(string)* Layout UUID or empty string.

<tt>assignLayoutToScreen()</tt>

Assign a layout to a screen for all virtual desktops.

Arg Direction Type Description
screenName in s *(string)* Target screen name.
layoutId in s *(string)* Layout UUID to assign.

<tt>clearAssignment()</tt>

Remove the layout assignment from a screen.

Arg Direction Type Description
screenName in s *(string)* Screen to clear assignment for.

<tt>setAllScreenAssignments()</tt>

Batch set all base screen assignments (saves once). Clears existing base assignments first.

Arg Direction Type Description
assignments in a{ss} *(dict<string,string>)* Map of screenName to layoutId.

<tt>getLayoutForScreenDesktop()</tt>

Get layout for a specific screen and virtual desktop (1-based).

Arg Direction Type Description
screenName 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.

<tt>assignLayoutToScreenDesktop()</tt>

Assign layout to a specific screen and virtual desktop.

Arg Direction Type Description
screenName in s *(string)* Target screen name.
virtualDesktop in i *(int32)* Virtual desktop index (1-based).
layoutId in s *(string)* Layout UUID to assign.

<tt>clearAssignmentForScreenDesktop()</tt>

Clear layout assignment for a screen/desktop combination.

Arg Direction Type Description
screenName in s *(string)* Screen name.
virtualDesktop in i *(int32)* Virtual desktop index (1-based).

<tt>hasExplicitAssignmentForScreenDesktop()</tt>

True if there is an explicit assignment (not inherited) for this screen/desktop.

Arg Direction Type Description
screenName in s *(string)* Screen name.
virtualDesktop in i *(int32)* Virtual desktop index (1-based).
hasAssignment out b *(bool)* True if explicit assignment exists.

<tt>getModeForScreenDesktop()</tt>

Get the current mode (0=Snapping, 1=Autotile) for a screen/desktop.

Arg Direction Type Description
screenName in s *(string)*
virtualDesktop in i *(int32)*
mode out i *(int32)*

<tt>getSnappingLayoutForScreenDesktop()</tt>

Get the snapping layout UUID for a screen/desktop (regardless of current mode).

Arg Direction Type Description
screenName in s *(string)*
virtualDesktop in i *(int32)*
layoutId out s *(string)*

<tt>getTilingAlgorithmForScreenDesktop()</tt>

Get the tiling algorithm ID for a screen/desktop (regardless of current mode).

Arg Direction Type Description
screenName in s *(string)*
virtualDesktop in i *(int32)*
algorithm out s *(string)*

<tt>setAllDesktopAssignments()</tt>

Batch set all per-desktop assignments (saves once). Key format: screenName:desktopNumber.

Arg Direction Type Description
assignments in a{ss} *(dict<string,string>)* Map of 'screen:desktop' to layoutId.

<tt>getAllDesktopAssignments()</tt>

Get all per-desktop assignments.

Arg Direction Type Description
assignments out a{ss} *(dict<string,string>)* Map of 'screen:desktop' to layoutId.

<tt>getVirtualDesktopCount()</tt>

Returns the number of virtual desktops.

Arg Direction Type Description
count out i *(int32)* Number of virtual desktops.

<tt>getVirtualDesktopNames()</tt>

Returns the names of all virtual desktops.

Arg Direction Type Description
names out as *(array<string>)* Array of desktop names.

<tt>getAvailableScreenIds()</tt>

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 (e.g. '{edid-uuid}' for physical, '{edid-uuid}/vs:0' for virtual subdivisions). Order follows the daemon's effective-screen iteration.

<tt>getAllScreenAssignments()</tt>

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.

<tt>getQuickLayoutSlot()</tt>

Get the layout ID assigned to a quick slot (1-9).

Arg Direction Type Description
slotNumber in i *(int32)* Slot number (1-9).
layoutId out s *(string)* Layout UUID or empty string.

<tt>setQuickLayoutSlot()</tt>

Assign a layout to a quick slot (1-9).

Arg Direction Type Description
slotNumber in i *(int32)* Slot number (1-9).
layoutId in s *(string)* Layout UUID to assign (empty to clear).

<tt>setAllQuickLayoutSlots()</tt>

Batch set all quick layout slots (saves once).

Arg Direction Type Description
slots in a{ss} *(dict<string,string>)* Map of slot number (as string) to layoutId.

<tt>getAllQuickLayoutSlots()</tt>

Get all quick layout slot assignments.

Arg Direction Type Description
slots out a{ss} *(dict<string,string>)* Map of slot number (as string) to layoutId.

<tt>getCurrentVirtualDesktop()</tt>

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.

<tt>isActivitiesAvailable()</tt>

True if KDE Activities are available.

Arg Direction Type Description
available out b *(bool)* True if Activities are available.

<tt>getActivities()</tt>

Returns the list of activity IDs.

Arg Direction Type Description
activityIds out as *(array<string>)* List of activity IDs.

<tt>getCurrentActivity()</tt>

Returns the current activity ID.

Arg Direction Type Description
activityId out s *(string)* Current activity ID.

<tt>getActivityInfo()</tt>

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.

<tt>getAllActivitiesInfo()</tt>

Returns metadata for all activities as JSON.

Arg Direction Type Description
activitiesJson out s *(string)* All activities metadata as JSON.

<tt>getLayoutForScreenActivity()</tt>

Get layout for a screen and activity (any desktop).

Arg Direction Type Description
screenName 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.

<tt>assignLayoutToScreenActivity()</tt>

Assign layout to a screen and activity.

Arg Direction Type Description
screenName in s *(string)* Target screen name.
activityId in s *(string)* KDE Activity ID.
layoutId in s *(string)* Layout UUID to assign.

<tt>clearAssignmentForScreenActivity()</tt>

Clear layout assignment for a screen/activity combination.

Arg Direction Type Description
screenName in s *(string)* Screen name.
activityId in s *(string)* KDE Activity ID.

<tt>hasExplicitAssignmentForScreenActivity()</tt>

True if there is an explicit assignment for this screen/activity.

Arg Direction Type Description
screenName in s *(string)* Screen name.
activityId in s *(string)* KDE Activity ID.
hasAssignment out b *(bool)* True if explicit assignment exists.

<tt>setAllActivityAssignments()</tt>

Batch set all per-activity assignments (saves once). Key format: screenName:activityId.

Arg Direction Type Description
assignments in a{ss} *(dict<string,string>)* Map of 'screen:activity' to layoutId.

<tt>getAllActivityAssignments()</tt>

Get all per-activity assignments.

Arg Direction Type Description
assignments out a{ss} *(dict<string,string>)* Map of 'screen:activity' to layoutId.

<tt>getLayoutForScreenDesktopActivity()</tt>

Get layout for screen, virtual desktop, and activity.

Arg Direction Type Description
screenName 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.

<tt>assignLayoutToScreenDesktopActivity()</tt>

Assign layout to screen, desktop, and activity.

Arg Direction Type Description
screenName 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.

<tt>clearAssignmentForScreenDesktopActivity()</tt>

Clear layout assignment for screen/desktop/activity.

Arg Direction Type Description
screenName in s *(string)* Screen name.
virtualDesktop in i *(int32)* Virtual desktop index (1-based).
activityId in s *(string)* KDE Activity ID.

Signals

<tt>currentActivityChanged</tt>

Emitted when the current KDE Activity changes.

Arg Direction Type Description
activityId out s *(string)* New current activity ID.

<tt>activitiesChanged</tt>

Emitted when the list of activities changes.

No payload.

<tt>virtualDesktopCountChanged</tt>

Emitted when the number of virtual desktops changes.

Arg Direction Type Description
count out i *(int32)* New virtual desktop count.

<tt>layoutChanged</tt>

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.

<tt>activeLayoutChanged</tt>

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.

<tt>layoutPropertyChanged</tt>

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).

<tt>layoutListChanged</tt>

Emitted when the list of layouts changes.

No payload.

<tt>layoutCreated</tt>

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.

<tt>layoutDeleted</tt>

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.

<tt>screenLayoutChanged</tt>

Emitted when a screen's layout assignment changes.

Arg Direction Type Description
screenName out s *(string)* Screen whose assignment changed.
layoutId out s *(string)* Assigned layout UUID.
virtualDesktop out i *(int32)* Virtual desktop number (0 = display default).