DankMaterialShell icon indicating copy to clipboard operation
DankMaterialShell copied to clipboard

Hyprland: display profiles can't tell identical monitors apart (serial dropped from profile identifier)

Open ThomasMeisters opened this issue 4 weeks ago • 5 comments

Compositor

Hyprland

Distribution

CachyOS

If Other, please specify

No response

Select your Installation Method

Distro Packaging

Was this your original Installation method?

No (specify below)

If no, specify

Originally installed DMS with the DMS installer (dankinstall). The switch from DMS to the dux-shell package (2.0.0-1.1) happened through a regular package upgrade on CachyOS.

dms doctor -vC

Click to expand

DMS Doctor Report

System

  • [ok] Operating System: CachyOS
    • ID: cachyos, Version: rolling, Arch: amd64
  • [ok] Architecture: amd64
  • [ok] Display Server: Wayland
    • WAYLAND_DISPLAY=wayland-1

Versions

  • [ok] DMS CLI: dms v2.0.0
    • /usr/bin/dms
  • [ok] Quickshell: Quickshell 0.3.2 (revision , distributed by Arch Linux)
    • /usr/bin/qs
  • [ok] DMS Shell: v2.0.0
    • /run/user/1000/dms-shell/496f460c1c70f6d9

Installation

  • [ok] DMS Configuration: Found
    • /run/user/1000/dms-shell/496f460c1c70f6d9
  • [ok] shell.qml: Present
    • /run/user/1000/dms-shell/496f460c1c70f6d9/shell.qml
  • [info] Install Type: Unknown
    • /run/user/1000/dms-shell/496f460c1c70f6d9

Compositor

  • [ok] Hyprland: 0.57.1
    • /usr/bin/hyprland
  • [info] Active: Hyprland
  • [ok] Background Blur: Supported
    • Compositor supports ext-background-effect-v1

Quickshell Features

  • [ok] Polkit: Available
    • Authentication prompts
  • [ok] IdleMonitor: Available
    • Idle detection
  • [ok] IdleInhibitor: Available
    • Prevent idle/sleep
  • [ok] ShortcutInhibitor: Available
    • Allow shortcut management (niri, Aqueous)
  • [ok] BackgroundBlur: Available
    • Background blur API support in Quickshell

Optional Features

  • [ok] accountsservice: Available
    • User accounts
  • [ok] power-profiles-daemon: Available
    • Power profile management
  • [ok] logind: Available
    • Session management
  • [ok] cups-pk-helper: Available
    • Printer management
  • [info] I2C/DDC: No monitors detected
    • External monitor brightness control
  • [ok] qt6-imageformats: Installed (1 formats)
    • Formats: GIF (/usr/lib/qt6/plugins/imageformats:/usr/lib64/qt6/plugins/imageformats)
  • [ok] kimageformats: Installed (4 formats)
    • Formats: AVIF, HEIF, JXL, EXR (/usr/lib/qt6/plugins/imageformats:/usr/lib64/qt6/plugins/imageformats)
  • [ok] Terminal: kitty, alacritty
  • [ok] Network: NetworkManager
    • NetworkManager present. Using NM API.
  • [ok] matugen: Installed
    • Dynamic theming
  • [ok] cava: Installed
    • Audio visualizer
  • [ok] khal: Installed
    • Calendar events
  • [ok] danksearch: Installed
    • File search
  • [ok] dankcalendar: Installed
    • Calendar app
  • [info] fprintd: Not installed
    • Fingerprint auth
  • [ok] adw-gtk3: Installed
    • GTK3 dynamic theming (user copy)

Config Files

  • [ok] settings.json: Present
    • /home/tmeisters/.config/dms/settings.json
  • [info] clsettings.json: Not yet created
    • /home/tmeisters/.config/dms/clsettings.json
  • [ok] plugin_settings.json: Present
    • /home/tmeisters/.config/dms/plugin_settings.json
  • [ok] session.json: Present
    • /home/tmeisters/.local/state/dms/session.json
  • [ok] dms-colors.json: Present
    • /home/tmeisters/.cache/dms/dms-colors.json

Services

  • [ok] dms.service: enabled, active
    • Wanted by hyprland-session.target
  • [ok] greetd: enabled
  • [ok] xdg-desktop-portal: Settings portal reachable

Environment

  • [info] QT_QPA_PLATFORMTHEME: gtk3
  • [ok] gtk3 plugin (Qt6): Installed
    • /usr/lib/qt6/plugins/platformthemes/libqgtk3.so
  • [info] QT_QPA_PLATFORMTHEME_QT6: gtk3
  • [info] QS_ICON_THEME: Not set
  • [warn] XDG_MENU_PREFIX: hyprland- (menu file not found)
    • Dolphin 'Open with…' dialog may be empty. Ensure hyprland-applications.menu exists in ~/.config/menus or /etc/xdg/menus.

Fonts

  • [ok] Normal Font: Google Sans Flex
    • /run/user/1000/dms-shell/496f460c1c70f6d9/DCommon/assets/fonts/google-sans-flex/GoogleSansFlex.ttf
  • [ok] Monospace Font: Fira Code
    • /run/user/1000/dms-shell/496f460c1c70f6d9/DCommon/assets/fonts/nerd-fonts/FiraCodeNerdFont-Regular.ttf
  • [ok] Display Font: DM Serif Display
    • /run/user/1000/dms-shell/496f460c1c70f6d9/DCommon/assets/fonts/dm-serif-display/DMSerifDisplay-Regular.ttf

Summary: 0 error(s), 1 warning(s), 40 ok

Description

I use a laptop plus two identical external monitors (2× Philips 243V7) through a USB-C dock. The dock comes up with different DP connector names on almost every replug: so far DP-3/DP-5, DP-4/DP-7 and DP-6/DP-9. As a result, my saved layout is lost on almost every replug.

Neither display naming mode can handle this setup:

  • "System" (connector) mode: profiles are keyed by DP-x, so they stop matching when the connectors renumber. outputs.lua keeps rules for the old connector names, the new connectors fall through to the { output = "", position = "auto" } catch-all, and Hyprland lays the monitors out in the wrong order.
  • "Model" mode: on Hyprland, getOutputIdentifier() → OutputModel.profileIdentifier() → modelIdentifier() returns only make + " " + model, without the serial (OutputModel.js#L57-L70, DisplayConfigState.qml#L236-L238). Both monitors get the same key, so one overwrites the other in monitors.json. An auto profile from my monitors.json:
"outputs": {
  "Philips Consumer Electronics Company PHL 243V7": { "position": { "x": 0, "y": 0 }, ... },
  "Lenovo Group Limited 0x40A9": { "position": { "x": 11721, "y": 0 }, ... }
}

That profile has three connected monitors but only two entries.

The niri path already includes the serial (niriIdentifier()), and so does hyprlandIdentifier(), which builds desc:Make Model Serial. Only the Hyprland profile key leaves it out.

Solutions tried

  • "System" naming mode: breaks whenever the connector names change.
  • Auto profile selection on and off: with it on, DMS kept creating new auto_* profiles, one per connector-name combination. One of them (DP-6/DP-9) has both monitors at 0x0.

Expected Behavior

In Model mode, profiles on Hyprland should identify monitors by make, model and serial, like niri does. Identical monitors would then get separate entries and a profile would match whichever connectors the dock assigns.

Steps to Reproduce

  1. On Hyprland, connect two monitors of the same model (with different serials).
  2. Set the display naming mode to "Model", arrange the monitors side by side and save a profile.
  3. Look at ~/.config/dms/monitors.json: only one entry exists for both monitors.
  4. Unplug and replug: the layout isn't restored correctly.

(In "System" mode, step 4 fails as soon as the dock renumbers the connectors.)

Error Messages/Logs

No response

Screenshots/Recordings

No response

ThomasMeisters avatar Nov 04 '26 08:11 ThomasMeisters

Hi there, note that we just released DMS 2.1 a few hours ago. We made a lot of Hyprland adjustments over the last couple of weeks. Let us know when you're updated to see if it's working!

purian23 avatar Nov 04 '26 08:11 purian23

Thanks! I updated to 2.1.0 (dux-shell 2.1.0-1.1, Hyprland 0.57.1), and it's still reproducible: after unplugging and replugging the dock, the layout comes back wrong.

outputs.lua is better now: each monitor gets a desc: rule with its serial. But profiles still key Hyprland outputs as make + " " + model (OutputModel.profileIdentifier() → modelIdentifier(), unchanged in v2.1.0). An auto profile written under 2.1 with three monitors connected still has two entries:

Lenovo Group Limited 0x40A9                    -> 3840x0
Philips Consumer Electronics Company PHL 243V7 -> 0x0

On top of that, it can never match again. outputSetFingerprint() is built from the live list, Lenovo…+Philips…+Philips…, while configFingerprint() comes from the stored keys, Lenovo…+Philips…. So on every hotplug applyAutoConfig() finds no match, regenerates the same auto_ id, and overwrites it with whatever layout Hyprland came up with. It never restores the saved one.

After the replug on 2.1 (the dock came back as DP-4/DP-7 instead of DP-3/DP-5), outputs.lua has only two monitor rules. The single Philips entry was applied to one of the two monitors, and the other one has no rule:

hl.monitor({ output = "desc:Philips Consumer Electronics Company PHL 243V7 0x00002791", mode = "[email protected]", position = "0x0", scale = 1 })
hl.monitor({ output = "desc:Lenovo Group Limited 0x40A9", mode = "[email protected]", position = "3840x0", scale = 1 })
hl.monitor({ output = "", mode = "preferred", position = "auto", scale = "auto" })

So the second Philips (…0x000027A0) falls through to the auto catch-all and Hyprland puts it to the right of the laptop:

Monitor Before unplugging After replugging
Philips …0x000027A0 0x0 (left) 5760x0 (right of the laptop)
Philips …0x00002791 1920x0 (middle) 0x0 (left)
Laptop eDP-1 3840x0 (right) 3840x0 (now in the middle)

That leaves an empty gap from x=1920 to 3840.

Using the serial in the Hyprland profile key, like niriIdentifier() does, should fix both.

ThomasMeisters avatar Nov 04 '26 10:11 ThomasMeisters

I'd like to take this one, could one of you assign me? @bbedward @purian23 I'd add the serial to the Hyprland profile key, the same way niriIdentifier() does, so two identical monitors get their own entries. I'd also make sure profiles saved with the old key keep working.

Mario-Mohar avatar Nov 05 '26 11:11 Mario-Mohar

Hi Mario, I submitted a pull-request with the fix you describe about two hours ago, it's #4138

ThomasMeisters avatar Nov 05 '26 11:11 ThomasMeisters

Thanks Thomas, I missed that.

Mario-Mohar avatar Nov 05 '26 15:11 Mario-Mohar