DTLdesktop — Reference Manual v1.1-1

Functional reference for the multi-monitor Windows desktop configuration manager.

versionv1.1-1dateJuly 16, 2026platformWindowsruntimePython 3.10 or later (ctypes)interfaceFrenchlicenseMIT

Preface

Purpose

This manual describes what DTLdesktop is, why it was created, and what it does. It is a functional and architecture reference. It deliberately contains no menu description, no command reference, and no step-by-step procedure.

DTLdesktop captures and restores a complete Windows desktop configuration — screen layout and orientation, per-monitor wallpaper, and the position of every desktop icon — as a named profile, and coordinates their restoration in a single verified operation.

Intended audience

This document is intended for administrators of multi-monitor workstations, maintainers of the NetDTL suite, and anyone who needs to understand DTLdesktop's capture and restoration behavior before integrating it into a workstation or a startup script.

Design principles

Scope: DTLdesktop acts on the display configuration, per-monitor wallpapers, and the position of desktop icons. It does not manage the content of the icons themselves, application window layout, or general Windows settings.

Background

Origin of the need

On Windows, the layout of desktop icons and the assignment of a wallpaper to each monitor are not reliably preserved when the screen configuration changes: adding, removing, or physically swapping a monitor, changing resolution or orientation, or reconnecting after sleep or a docking-station change. Windows then redistributes icons according to its own logic, and the association between a given wallpaper and a given screen can be lost or shifted to the wrong screen.

An aggravating factor lies in how screens are named in the first place: the identifiers Windows assigns to each monitor are not stable over time. A simple physical swap of two screens can be enough to reverse this numbering, even though the layout the user actually intended has not changed.

Problem addressed

DTLdesktop was created to address this problem at its root: recognize a screen configuration by its geometry rather than by the name Windows happens to assign it at a given moment, and restore, in a single verified operation, the entire desktop state associated with that configuration — orientation, resolution, the wallpaper matching each screen's current orientation, and the position of every icon.

Reference point: a physical swap of two monitors is enough, on Windows, to reverse the device names assigned to them. DTLdesktop's configuration signature ignores this naming and recognizes the layout from the screens' actual geometry.

Architecture

Overview

DTLdesktop is organized into three layers: a system-access layer for Windows display, per-monitor wallpaper, and desktop icon APIs; a profile-modeling layer that captures, compares, and applies a desktop state; and a presentation layer, interactive or non-interactive.

If verification of any of these three branches fails, DTLdesktop attempts to automatically roll back to the desktop state captured just before the application.

Components

LayerResponsibility
System accessEnumeration of screens and their display modes, reading and writing per-monitor wallpapers, reading and writing desktop icon positions inside the Windows Explorer process.
Profile modelCapture, load, compare, diagnose, coordinated apply, and automatic recognition of a desktop configuration.
PresentationInteractive keyboard-driven mode and non-interactive mode intended for integration into a workstation or a startup script.

File organization

Application

DTLdesktop.py

Complete implementation of the tool: system access, profile model, and presentation.

Profiles

Desktop/<profile name>/monitors.jsonicons.jsonwallpaper.json

Captured state of a named configuration: screens, icons, and per-monitor wallpapers.

Settings

Desktop/settings.json

Active profile and the last image folder used for wallpaper selection.

Data model

Configuration signature

Each profile records a normalized geometric signature of the full set of screens: position relative to the top-left-most screen, width, height, orientation, and primary-screen status, sorted deterministically. This signature makes no reference to any device name. It is recomputed from the actually observed configuration whenever a comparison is needed, which lets a previously known layout be recognized even if Windows has renamed or renumbered the screens since the profile was captured.

Screen identification

Beyond the geometric signature, each screen has a native Windows identifier used to associate it with its wallpaper; this identifier is distinct from the display device name. When every identifier of a profile is found in the current configuration, the match is established on that basis; otherwise it relies on the geometric signature alone.

Icon identification

Each desktop icon is identified by its name and by its rank among icons sharing that same name, which distinguishes several identically named icons present on the desktop at the same time. This pair serves as the key used, during restoration, to find the icon matching a saved position.

Profile versions

The document describing wallpapers has evolved from a single global wallpaper format to a format that associates, with each screen, a distinct wallpaper for landscape orientation and a distinct one for portrait orientation. A profile in the older format remains readable and continues to work; it is rewritten in the newer format as soon as a wallpaper is reconfigured for one of its monitors.

Features

Screen configuration detection

DTLdesktop queries the Windows monitor enumeration API to obtain, for each screen, its position, dimensions, orientation, rotation, and primary-screen status. This reading is complemented with the identifier and wallpaper associated with each monitor; when the per-monitor wallpaper interface is unavailable, DTLdesktop falls back to Windows's global wallpaper.

Capturing and restoring desktop icons

DTLdesktop reads, directly inside the Windows Explorer process, the list view that holds the desktop icons — the name and position of each — and can then write those positions back into the same list. This reading and writing crosses the process boundary through a memory region allocated inside Explorer, because the desktop icon list belongs to that process, not to DTLdesktop.

Per-monitor wallpaper management

DTLdesktop associates two distinct wallpapers with each screen of a profile, one for landscape orientation and one for portrait orientation, and applies whichever matches the screen's actual orientation at the time of restoration. The "Fill" display mode is systematically checked and reapplied if Windows has not preserved it.

Coordinated profile application and safety

Applying a profile changes, in order, screen layout and orientation, then wallpapers, then icon positions, and then verifies that all three actually match the expected state. Before any change, the current desktop state — display modes, wallpapers, icons — is kept in memory. If verification fails at any step, DTLdesktop attempts to automatically restore that previous state rather than leaving the desktop in a non-conforming intermediate state.

Diagnostics and comparison without changes

DTLdesktop can compare the current desktop state to a saved profile — orientation or resolution discrepancies, icons that have moved, gone missing, or newly appeared, non-conforming wallpapers — without applying any change. This function is used to examine a discrepancy before deciding on a correction.

Profile recognition and automation

From the geometric signature of the current configuration, DTLdesktop determines whether it exactly matches a saved profile, whether it matches a compatible profile with different screen identifiers, or whether it is a new configuration with no associated profile. This recognition does not depend on the device names Windows assigns, and therefore remains valid after a physical swap of screens. DTLdesktop can be used interactively or non-interactively, which allows automatic restoration of the recognized profile to be integrated into a workstation or a task run at startup.

Internal reference

Internal modules

ComponentRole
WindowsDesktopLow-level access to screen enumeration, display modes, and the desktop icon list.
DesktopWallpaperAPIAccess to the Windows per-monitor wallpaper interface, with fallback to the global mechanism.
RemoteMemoryAllocation of, and access to, a memory region inside the Windows Explorer process, used to read and write desktop icons.
DesktopManagerProfile model: capture, load, compare, diagnose, coordinated apply, and recognition.

Robustness and integrity

Appendices

Known limits

Versions and schemas

IdentifierValueScope
Applicationv1.1-1Distributed features.
Profile format (screens, icons)1Structure of monitors.json and icons.json.
Profile format (wallpapers)2Per-orientation structure of wallpaper.json; format 1, with a single global wallpaper, remains readable for compatibility.

Glossary

TermDefinition
ProfileNamed set of documents describing a captured desktop configuration: screens, icons, and wallpapers.
Configuration signatureNormalized representation of screen geometry, independent of the names Windows assigns.
OccurrenceRank of an icon among desktop icons sharing the same name, used to find it unambiguously.
Landscape wallpaper / portrait wallpaperWallpaper associated with a monitor for each of its two possible orientations.
RollbackRestoration of the previous desktop state when verification of a profile application fails.
Compatible profileA profile whose geometry matches the current configuration but whose screen identifiers differ from the ones recorded.