Skip to content

Show one display at a time in the display panel, with a layout map - #17159

Merged
dhh merged 30 commits into
quattrofrom
monitor-display-segments
Oct 31, 2026
Merged

dhh merged 30 commits into
quattrofrom
monitor-display-segments

Conversation

@dhh

@dhh dhh commented Oct 31, 2026 •

Copy link
Copy Markdown
Contributor

The display panel shows one display at a time, with its own brightness, scale and resolution, and gains a layout map for arranging several. Replaces #17147, whose commits are included here.

One display at a time

  • The hero names the display shown ("Built-in Display", else the monitor's model) with its brightness mood, and a button per display on its right picks another. It opens on the focused display.
  • Below it come that display's brightness, text size, scale and resolution, then the layout map.
  • Brightness is per display. omarchy-monitor-state reads every enabled display's level in parallel, since a DDC read takes a moment per monitor. Text size stays one setting: the shell font, GTK and the terminals each take a single size.
  • The display list and turning displays on and off are gone.

Resolution and scale per display

  • Resolution options come from each display's own advertised modes: its native size, then smaller modes of the same shape down to 1080p, capped at five and listed smallest to largest. Tiled half-modes and odd legacy sizes stay out. A 6K Pro Display XDR shows 1440p · 4K · 5K · 6K; a typical 4K monitor shows 1080p · 1440p · 4K.
  • New omarchy-hyprland-monitor-resolution [--monitor NAME] [WIDTHxHEIGHT[@RATE]] sets a mode, refusing anything the display doesn't advertise. Without a rate it takes the fastest one. It keeps the current scale, rounded to one the new mode accepts.
  • omarchy-hyprland-monitor-scaling takes --monitor NAME, and the panel drives the shown display's scale through it.

Layout

  • The map draws the displays that are on where they sit, at their relative sizes. Drag one against another's side and it lands there, snapping to that display's start, center or end. h/l moves the shown display to the left or right of the rest.
  • New hidden omarchy-hyprland-monitor-layout NAME=XxY… applies every position in one eval and saves them. Its --resized mode keeps neighbours touching when a scale or resolution change resizes a display, and those commands keep the display's place instead of handing it to auto placement.

Persistence, by the physical monitor

  • Choices are saved in ~/.local/state/omarchy/monitors/settings, one tab-separated line per monitor: mode, position, scale and the monitor's identity (make, model and serial, as monitor-workspaces names it). A dock renames connectors between plugs, so settings keyed by DP-1 would land on whatever monitor turned up on that port.
  • The hidden omarchy-hyprland-monitor-persist writes that file, and refuses any value out of place. It moves out of the scaling command, which used to edit monitors.lua with awk.
  • New default/hypr/monitor-settings.lua, loaded from toggles.lua after hypr/monitors.lua, applies the saved settings while the config loads and again when a monitor arrives, skipping one already running as saved. It sets GDK_SCALE from the lowest scale too, so monitors.lua is never written. Rules written there by earlier versions keep working until a monitor's settings are changed in the panel.
  • Monitor state shares one directory: monitors/settings, monitors/workspaces (and monitors/workspaces-merged), formerly monitor-workspaces, and monitors/scaling, formerly monitor-scaling.log. A migration moves the existing files, and monitor-workspaces.lua reads the old blocks until it runs.

monitors.lua is for the extras

  • Omarchy's default monitor rule (preferred mode, automatic position, scale "auto") and GDK_SCALE 2 move into default/hypr/monitors.lua. The shipped hypr/monitors.lua is commented examples for agents and power users: rotation, modes the panel doesn't offer, keeping a monitor off, matching by description, 10-bit color, VRR, and overriding the default scale or GDK_SCALE. Existing copies keep working, loading after the defaults.
  • Setup > Monitors leaves the Omarchy menu.
  • Clamshell recovery reads the panel's saved mode, position and scale for the laptop panel before monitors.lua, so a numeric scale there no longer corrects a panel-chosen one back on idle-wake. The connector-to-monitor lookup moves into a hidden omarchy-hyprland-monitor-identity.
  • The Omarchy agent skill sets scale, resolution and position through the monitor commands.

Review
A Codex review found two bugs, both fixed here with tests: a resize could push two neighbours onto each other, and a brightness change made elsewhere could leave the panel showing a stale level.

Known limits

  • Moving a display makes the shell close and reopen its per-screen windows (bar, background, dock), which looks abrupt. A config reload alone doesn't; the position change does. Whether Hyprland or Quickshell is behind it isn't pinned down yet.
  • Pulling a display out of the middle of a row leaves a gap, and identical external monitors share one picker icon.

Verified in the running panel on a laptop beside a 6K display, including layout moves, resolution changes and a simulated four-display arrangement. Tests cover resolution options, the scaling, resolution and layout commands, the layout math, per-display brightness and display naming.

🤖 Generated with Claude Code

dhh and others added 16 commits October 31, 2026 14:15
The display panel gets a Resolution row beneath Scale, and both rows now
show one line per enabled display instead of acting on the focused one.
Resolutions come from each display's own advertised modes: its native
size and the smaller modes of the same shape, smallest to largest.

omarchy-hyprland-monitor-resolution sets a display's mode, and it and
omarchy-hyprland-monitor-scaling take --monitor NAME. Both save through
omarchy-hyprland-monitor-persist, which now writes the mode alongside the
scale, so a chosen resolution survives reloads and later scale changes.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Each display gets a segment of its own, as each agent does in the agents
panel: its name and an on/off switch, then its brightness, scale and
resolution. This replaces the display list at the bottom. Brightness is
read and set per display. Text size stays one row above the segments,
since the shell font, GTK and the terminals each take a single size.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
The display panel shows one display at a time, under a tab per display,
and opens on the focused one. Its rows sit under the tabs: an on/off
switch, brightness, scale and resolution. Text size sits above the tabs,
since it applies to every display.

A layout map at the bottom draws the displays where they sit. Drag one
against another's side to move it there, snapping to that display's
start, center or end. h/l moves the open display to the left or right
of the others. omarchy-hyprland-monitor-layout applies every position
in one eval, and omarchy-hyprland-monitor-persist now saves a position
along with the scale and mode.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
The hero names the display the panel shows, with a button per display
on its right to pick another. It opens on the focused display. That
display's brightness, scale and resolution follow the hero, and text
size and the layout map come last, since every display shares them.
Displays can no longer be turned on and off from the panel.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
A scale or resolution change beside other monitors now keeps the
monitor's position instead of handing it to Hyprland's auto placement.
Every monitor to its right or below it then shifts by however much it
grew or shrank, through omarchy-hyprland-monitor-layout --resized, and
the positions are saved. A smaller mode no longer leaves a gap beside
it, and a larger one no longer overlaps its neighbour.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Rows of pills take the same room above and below as a slider row, and
the layout map is as tall as the arrangement inside a slider-like row,
so every section keeps the same rhythm. The picker's display icons no
longer sit in boxes.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
omarchy-hyprland-monitor-persist writes its arguments straight into the
Lua that Hyprland loads on every change. It now refuses anything that
isn't a plain connector, scale, mode or position, and skips GDK_SCALE
when the lowest scale can't be read, instead of writing a broken rule
or an empty assignment that leaves the whole config unloadable.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
A slider's row is as tall as its knob, with the thin track centered in
it. Rows of pills and the layout map now take the room around that
track rather than half a control gap, and the spacer at the end of the
panel goes, so every gap above and below what's drawn is the same.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Bringing a row into view added a margin below it even when it was the
last row and the panel already fit, which scrolled the content past its
end and cut the hero off at the top. The scroll now stops at either end.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
The map no longer sits in a cursor box that lights on hover. When the
keyboard is on it, the shown display's outline thickens instead.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Each section label has an icon beside it: a sun for brightness, letter
case for text size, expanding arrows for scale, full-screen corners for
resolution and two monitors for layout. The hero's display picker is one
segmented control, a frame with a cell per display and the shown one
filled, instead of separate buttons.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
This reverts commit 542cfda: the section icons and the segmented
display picker didn't land well, so the panel goes back to plain labels
and separate picker icons.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Shifting the monitors to the right of and below a resized one at once
could push two of them onto each other, as with two screens stacked
beside a tall one. A shifted monitor that overlaps another now goes back
where it was whenever that spot is free, so the layout keeps a gap
rather than an overlap.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
The panel skipped a poll whose display list matched the last one, and
the list carried brightness, so a level changed elsewhere and changed
back could leave the panel showing a stale one for good. Brightness now
comes from every poll, and only the rest of the list is compared before
rebuilding the picker and layout.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@greptile-apps

greptile-apps Bot commented Oct 31, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerView in GreptileConfidence Score: 5/5

[Medium impact] The PR appears safe to merge; the outstanding scaling-history issue is fixed.

Summary

This PR adds per-display controls, a layout map, and settings saved by physical monitor.

  • The panel shows one display’s controls at a time.
  • The layout map lets you place screens beside one another.
  • Monitor commands set the chosen screen’s scale and resolution.
  • Saved monitor choices follow each physical display across ports.
  • Brightness readings and changes belong to each display.
  • Monitor configuration examples now cover settings outside the panel.

Reviews (11) · Last reviewed commit: "Stop the monitors/ migration when the sc..." · Reviewed by Greptile

Comment thread bin/omarchy-hyprland-monitor-layout Resolved
Comment thread shell/plugins/panels/monitor/Panel.qml Resolved
@greptile-apps

This comment has been minimized.

@dhh
dhh changed the base branch from monitor-resolution-picker to quattro October 31, 2026 15:03
dhh and others added 3 commits October 31, 2026 10:20
A shifted monitor that overlapped nothing never went back, so it could
block the return of two that overlapped each other, and the overlap was
saved. While any overlap remains, any shifted monitor whose old spot is
free now goes back, the overlapping ones first. If overlaps still remain,
the monitors keep their old places when those are clear.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Dropping the map's highlight box also dropped its hover handler, so
after using a scale or resolution row, h/l kept walking that row's pills
instead of moving the shown display. The pointer on the map takes the
shared cursor again, without drawing a box.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
The display panel's scale, resolution and layout choices were written into
~/.config/hypr/monitors.lua as rules naming the connector. A dock renames
its connectors between plugs, so a rule for DP-1 handed one monitor's mode
and position to whatever turned up on that port next, and editing the
user's Lua in place could leave the whole config unloadable.

omarchy-hyprland-monitor-persist now saves one line per monitor in
~/.local/state/omarchy/monitor-settings, keyed by the identity
monitor-workspaces gives it: make, model and serial. The new
default/hypr/monitor-settings.lua, loaded from toggles.lua after
hypr/monitors.lua, applies them while the config loads and again when a
monitor arrives, skipping one already running as saved. It also sets
GDK_SCALE from the lowest scale, so monitors.lua is never written, and
--keep-gdk goes.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Comment thread bin/omarchy-hyprland-monitor-persist Resolved
dhh and others added 2 commits October 31, 2026 10:38
The saved settings move from ~/.local/state/omarchy/monitor-settings to ~/.local/state/omarchy/monitors/settings, a directory of their own.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
…ors/

Each monitor's workspace blocks move to monitors/workspaces (with
monitors/workspaces-merged beside them) and the scaling log to
monitors/scaling, next to monitors/settings. A migration moves the
existing files over. Until it runs, monitor-workspaces.lua still reads
the old blocks, so a config reload first doesn't cost a monitor its
workspaces.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Comment thread migrations/1793461630.sh Resolved
dhh and others added 2 commits October 31, 2026 10:47
A layout moves every monitor in one step, then saves them one at a time,
and each save replayed every monitor's saved settings. One not yet saved
was pulled back to its old position, then forward again on its own save.
A save now replays only its own monitor, which already runs as saved, so
it just brings GDK_SCALE up to date.

The monitors/ migration takes a fresh timestamp: quattro gained an
unrelated migration under the same one.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
The panel no longer turns displays on and off, so toggleDisplay and its test go.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
dhh and others added 5 commits October 31, 2026 17:07
The monitor panel now sets each monitor's scale, resolution and arrangement, so the menu no longer opens monitors.lua for them.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Clamshell recovery took the internal panel's scale and position from
monitors.lua, but choices made in the display panel now live in the
monitor settings and win over that file. A numeric scale there corrected
a panel-chosen one back on every idle-wake, and the panel came back at
its old mode and position. Clamshell now reads the saved mode, position
and scale first.

The connector-to-monitor lookup both need moves into a hidden
omarchy-hyprland-monitor-identity.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Omarchy's default monitor rule and GDK_SCALE move into
default/hypr/monitors.lua, so the shipped hypr/monitors.lua is only
commented examples for agents and power users: rotation, modes the
panel doesn't offer, keeping a monitor off, matching by description,
10-bit color, VRR, and overriding the default scale or GDK_SCALE.
Existing copies keep working: they load after the defaults.

The Omarchy agent skill sets scale, resolution and position through the
monitor commands, and the manual follows.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
toggles.lua now loads the saved monitor settings, which listen for monitors arriving, so the fake hl the test loads it with needs hl.on.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
The copy hid every failure behind || true, so a full disk could replace
the log with a partial one, delete the original and still mark the
migration done. The old log now moves over when there's nothing newer,
and otherwise a failed copy stops the migration before anything is
replaced or deleted, leaving it pending.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@dhh
dhh merged commit 9dbd12d into quattro Oct 31, 2026
3 checks passed
omarchybot added a commit to ekollof/omarchy that referenced this pull request Nov 1, 2026
The display panel was rewritten on quattro (omacom#17159, omacom#17170, omacom#17175) with a taller cap and its full-card ScrollView kept, so it keeps scrollOverflow: false beside the new contentHeight.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
omarchybot added a commit to fbalazsy/omarchy that referenced this pull request Nov 2, 2026
quattro now reads the panel's mode from the display panel's saved settings (omacom#17159) and says disabled = false when recovering an unplugged panel (omacom#16310). read_monitor_mode takes the saved mode first, then the internal rule, then the catch-all, and enable_internal_output keeps quattro's disabled = false. The mode tests are rewritten on quattro's expect_sync helper, since the fixtures they used were removed in omacom#16756, with one more for the display panel's mode winning over the rule's.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@emirb emirb added this to the 4.6.0 milestone Nov 5, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants