Skip to content

Allow disabling and re-enabling displays from the monitor panel - #22021

Open
Darkiu1337 wants to merge 2 commits into
omacom:quattrofrom
Darkiu1337:feat/monitor-panel-disable
Open

Darkiu1337 wants to merge 2 commits into
omacom:quattrofrom
Darkiu1337:feat/monitor-panel-disable

Conversation

@Darkiu1337

Copy link
Copy Markdown

Summary

  • Add a Disable action to the layout map's right-click (and keyboard r) context menu in omarchy.monitor, guarded so the last active display can never be disabled.
  • Use omarchy-hyprland-monitor-internal off for built-in displays (preserving clamshell/unplug recovery, and turning off managed mirroring first if active) and hyprctl eval for external displays.
  • Keep the LAYOUT section visible whenever connected displays are disabled and show dimmed <output> · disabled chips below the layout map so any disabled display can be re-enabled in one click (restoring saved monitor_settings).
  • Add English catalog strings (monitor.disable, monitor.disabledTag, monitor.enableDisplay) to default/i18n/en/shell.json.

Testing

  • bash test/shell.d/monitor-test.sh
  • bash test/shell.d/i18n-test.sh
  • bash test/shell.d/monitor-state-test.sh
  • bash test/shell.d/monitor-output-name-test.sh
  • Verified visually in the running shell on a laptop + external HDMI setup.

Filed by Gemini 4 Neon via Antigravity.

@Darkiu1337

Copy link
Copy Markdown
Author
image

@greptile-apps

greptile-apps Bot commented Dec 6, 2026 •

Copy link
Copy Markdown
Contributor

Confidence Score: 4/5RetriggerView in Greptile

[Medium impact] The changes affect display controls for users of the monitor panel.

Hold merging until queued disables are shown to preserve the last active display.

Findings

  1. P1 Both screens can turn off ▶
Fix with agent prompt
### Issue 1
shell/plugins/panels/monitor/Panel.qml:563-570
With two external displays active, disabling one and then the other before the state read finishes lets both calls see `segments.length > 1`. The queued commands never check again, so they can turn off every physical display. Brightness probes delay the state read and extend this window.

Recheck the active outputs when each disable runs instead of trusting the earlier panel state.

---

For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.

Summary

This PR adds display controls to the monitor panel.

  • The layout menu lets users disable a display while keeping another one active.
  • Disabled connected displays stay visible and can be turned back on.

Reviews (2) · Last reviewed commit: "Recheck active outputs on disable and su..." · Reviewed by Greptile

Comment thread shell/plugins/panels/monitor/Panel.qml Outdated
Comment on lines +563 to +570
if (!isSafeMonitorName(name) || segments.length <= 1) return
if (/^(eDP|LVDS|DSI)-/.test(name)) {
if (mirrorEnabled && mirrorManaged) {
runAction(["omarchy-hyprland-monitor-internal-mirror", "off"])
}
runAction(["omarchy-hyprland-monitor-internal", "off"])
} else {
runAction(["hyprctl", "eval", "hl.monitor({ output = \"" + name + "\", disabled = true })"])

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Both screens can turn off

With two external displays active, disabling one and then the other before the state read finishes lets both calls see segments.length > 1. The queued commands never check again, so they can turn off every physical display. Brightness probes delay the state read and extend this window.

Recheck the active outputs when each disable runs instead of trusting the earlier panel state.

Prompt To Fix With AI
This is a comment left during a code review.
Path: shell/plugins/panels/monitor/Panel.qml
Line: 563-570

Comment:
**Both screens can turn off**

With two external displays active, disabling one and then the other before the state read finishes lets both calls see `segments.length > 1`. The queued commands never check again, so they can turn off every physical display. Brightness probes delay the state read and extend this window.

Recheck the active outputs when each disable runs instead of trusting the earlier panel state.

---

For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.

Comment thread shell/plugins/panels/monitor/Panel.qml Resolved
@omarchybot omarchybot added the enhancement New feature or request label Dec 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants