Skip to content

menu: Add Auto Brightness On and Off rows for Apple Silicon - #18986

Open
joshuaswarren wants to merge 5 commits into
omacom:quattrofrom
joshuaswarren:w7H/menu-auto-brightness
Open

joshuaswarren wants to merge 5 commits into
omacom:quattrofrom
joshuaswarren:w7H/menu-auto-brightness

Conversation

@joshuaswarren

@joshuaswarren joshuaswarren commented Nov 15, 2026 •

Copy link
Copy Markdown

What changes

Adds two menu rows, Auto Brightness On and Auto Brightness Off, in the Toggle group. They run omarchy-brightness-auto toggle from omacom/omarchy-mac-pkgs#144 (the command) with wluma from omacom/omarchy-pkgs#2808; a fresh Mac does not get wluma through omarchy-mac, it is installed by hand with omarchy-pkg-add wluma, and the rows appear once both are there, which switches the screen and keyboard backlight between following the ambient light sensor and staying manual, like macOS. The rows show only on Apple Silicon and only when omarchy-brightness-auto and wluma are installed, so no other machine sees them. The On row also needs an ambient light sensor, the same in_illuminance_* files omarchy-brightness-auto looks for, so a Mac without one is not offered a toggle that would refuse. The glob is wider than the command's check: a device that has only in_illuminance_scale would show On, and toggle would then refuse. I do not know of such a device, and the guard stays a builtin with no process start. The English catalog gets the two labels.

The guard asks for the commands before the hardware (omarchy-cmd-present is answered in-process, the hardware predicate forks), so a machine without them forks nothing. Both rows run the same toggle, as the other pairs do. Each reads the state by piping omarchy-brightness-auto status --json to grep, which keeps it out of the guard readers, so the guard batch gains no command that every machine would run.

Verification

  • test/shell.d/menu-test.sh: the toggle pair check failed first (the two rows had different actions), and passes now.
  • test/shell.d/i18n-test.sh: the catalog check failed first (labels missing), and passes now.
  • test/shell.d/menu-guards-test.sh and menu-plugin-test.sh pass.
  • menu-images-test.sh (a lazy image queue case) fails on this machine with and without the change. keybindings-menu-test.sh needs lua, which is not installed here. menu-guard-budget-test.sh and menu-open-budget-test.sh skip on this machine (slow host, no compositor).
  • The sensor glob listed in_illuminance_input on a MacBook Pro 16-inch (M1 Max) and matched nothing on a machine without a sensor.
  • On a MacBook Pro 14-inch (M5 Max) the command itself ran on and off with wluma reading the sensor; the menu rows were not clicked there.

Screenshots

None yet. The rows still have to be opened in the running menu on a Mac with local builds of both packages; screenshots of each state will be added then.

Validated on, and reach

Validated on: nothing in the running menu. The command behind the rows ran on a MacBook Pro 14-inch (M5 Max); the rows were checked by the shell tests only.
Beyond that Mac: the rows show only on Apple Silicon with omarchy-brightness-auto and wluma installed, so every other machine is unchanged.

omarchy-brightness-auto (omarchy-mac-pkgs) turns ambient light brightness for
the screen and keyboard on or off. The two rows show only on Apple Silicon and
only when that command and wluma are installed, so no other machine sees them.
Both rows run the command's toggle, as the other toggles do, and each reads the
state by piping status --json to grep, so the guard batch needs no new reader.

Tested: menu-test.sh (the toggle pair check failed first with a differing
action) and i18n-test.sh (the catalog check failed first without the labels)
pass; menu-guards-test.sh passes. menu-images-test.sh and
keybindings-menu-test.sh fail on this machine without the change too (a lazy
image queue case, and no lua).

Signed-off-by: Joshua Warren <816217+joshuaswarren@users.noreply.github.com>
@greptile-apps

greptile-apps Bot commented Nov 15, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerView in GreptileConfidence Score: 5/5

[Low impact] No new blocking issue was found in the latest guard change.

Summary

Adds Auto Brightness On and Off rows for Apple Silicon, with matching English labels.

  • Apple Silicon users can switch automatic brightness from the Toggle menu.

Reviews (7) · Last reviewed commit: "menu: hide Auto Brightness On when no pa..." · Reviewed by Greptile

@joshuaswarren
joshuaswarren changed the base branch from master to quattro November 15, 2026 11:30
@joshuaswarren

Copy link
Copy Markdown
Author

PASS on c4a9361
Model: zai/glm-5.3

Read the full 30-line diff against the quattro base. The two menu rows follow the neighboring toggles' shape exactly (icon/label/when/action, the on/off pair mutually exclusive via the ! in the when condition) and gate correctly: Apple Silicon hardware check, command-presence check for both omarchy-brightness-auto and wluma, and the enabled state read from status --json with a fixed-string grep (no regex injection from the JSON). The i18n labels land in the right trigger.toggle block. The when condition runs the JSON status through a pipe inside [[ ]] - consistent with the nightlight rows above, which use the same pattern, so no new shell-eval surface. The rows do nothing on machines without the sensor (omarchy-brightness-auto refuses with a named error) - the hardware gate plus command gate make the common case invisible.

Model: zai/glm-5.3

@maralcbr maralcbr left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thanks @joshuaswarren. Gating the rows on the command and wluma is the right shape, and keeping status out of GUARD_READERS with the pipe form is a good call, since as a reader it would start on every machine. Two things before merge, plus a small fix:

  1. Pin the status contract against omacom/omarchy-mac-pkgs#144. Both guards match the literal "enabled":true (default/omarchy/omarchy-menu.jsonc:169-170). If #144 prints "enabled": true, or the shape changes before it lands, the Off row never shows and picking "Auto Brightness On" turns it off. Any failed or empty read also shows "Auto Brightness On", even without pipefail. Could you quote the line in #144 that prints the JSON, have brightness-auto-test.sh assert that exact substring, and say what status --json and toggle do when the sensor or wluma isn't usable?
  2. Check the rows in the running menu. agents/skills/visual-verification.md covers menus and asks for the evidence in the PR's Screenshots section, which currently says "None taken". Please open Toggle on a Mac with local builds of #144 and omacom/omarchy-pkgs#2808, pick each row, confirm it flips, and add a screenshot of each state.

Smaller things:

  • Check for the commands before the hardware. omarchy-hw-aarch64-apple is a real process (bin/omarchy-hw-aarch64-apple:16, which also runs omarchy-hw-platform). As written, every machine runs it twice per menu batch, even where the rows can never show. omarchy-cmd-present is answered in-process (shell/plugins/menu/MenuModel.js:518), so putting it first means machines without the commands fork nothing, which is what the body promises. Suggested: omarchy-cmd-present omarchy-brightness-auto wluma && omarchy-hw-aarch64-apple && ….
  • Please name omacom/omarchy-pkgs#2808 in the body, and say whether a fresh Mac gets wluma through omarchy-mac's dependencies or needs it installed by hand. I can't tell which from this repository.
  • The menu batch runs under bash -lc (shell/plugins/menu/Menu.qml:1225), so a profile that sets pipefail makes the result depend on status's exit code. Worth confirming in #144 that it exits 0 whenever it prints JSON.

CI: only the Greptile check has reported. No result from Tests, the i18n check or visual evidence is shown for c4a9361, so nothing here has been tested in CI yet.

This adds visible rows on Macs and keeps auto brightness Mac-only, which AGENTS.md:94 limits to things that can't exist elsewhere. Whether to accept that scope, or gate on the commands alone by dropping the hardware check, needs an explicit maintainer decision. For release (not the merge): a check on hardware that the backlight follows the sensor after On and stays put after Off.

Reviewed at c4a936191476.

— Marcelo's agent

The guard batch answers omarchy-cmd-present in-process but runs
omarchy-hw-aarch64-apple as a process, which itself runs omarchy-hw-platform. With
the hardware check first, every machine forked both on each menu batch although
the rows can never show without the commands. Asking for the commands first
means a machine without them forks nothing.

Tested: menu-test.sh gained a check that both rows start with the command
presence test; it failed on the previous order and passes now. i18n-test.sh,
menu-guards-test.sh and menu-plugin-test.sh pass.

Signed-off-by: Joshua Warren <816217+joshuaswarren@users.noreply.github.com>
Comment thread test/shell.d/menu-test.sh Resolved
@joshuaswarren

Copy link
Copy Markdown
Author

Thanks for the review. Head is now 09608d0.

  1. Status contract: the line that prints the JSON is omarchy-mac-pkgs#144, omarchy-mac/bin/omarchy-brightness-auto:198, printf '{"enabled":%s,"lux":%s}\n'. Its test asserts the exact output ({"enabled":true,"lux":123}), that the "enabled":true substring is there when on, and that status --json exits 0 and still prints JSON with no sensor and no wluma ({"enabled":false,"lux":null}). toggle goes through on when off: with no wluma, no sensor, or no panel and no config it exits 1 with a message and starts nothing. That is the one case where the On row does nothing; the rows only show when both commands exist.
  2. Running menu: not done yet. It needs the M5 Max with local builds of hypr: added custom script to use wofi as xdph share-picker #144 and wluma 5.0.4: ambient light brightness for the screen and keyboard omarchy-pkgs#2808, and I will add screenshots of each state when I have them. The Screenshots section says so.

Smaller: the guard now asks for the commands first (omarchy-cmd-present omarchy-brightness-auto wluma && omarchy-hw-aarch64-apple && ...), pinned by a menu-test.sh check that failed on the old order. omarchy-pkgs#2808 is named in the body. A fresh Mac does not get wluma through omarchy-mac's dependencies; it is installed by hand with omarchy-pkg-add wluma, and the rows appear once it is.

@maralcbr maralcbr left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

@joshuaswarren re-reviewed at 09608d0. Thanks for the quick turnaround. The guards now ask for the commands before the hardware (default/omarchy/omarchy-menu.jsonc:169-170), so machines without them skip the omarchy-hw-aarch64-apple fork. The body names omacom/omarchy-pkgs#2808 and says how wluma gets installed. Your answer on the status contract covers my first point and the pipefail question, going by the line you quoted from omacom/omarchy-mac-pkgs#144 and the exit-0 behaviour you describe.

Two things before merge:

  1. The On row shows when auto brightness can't work, and picking it fails silently. ! … status --json | grep -Fq '"enabled":true' (omarchy-menu.jsonc:169) reads every non-enabled state as off. As you describe it, toggle then exits 1 with a message when there's no sensor or no panel. The menu runs actions detached (shell/plugins/menu/Menu.qml:164-172), so nobody sees that message. wluma installed by hand on a Mac where the sensor isn't usable is enough to reach this. Could you either gate the On row on availability (for example an availability field in status --json, or a cheap readiness check from #144), or have #144's toggle/on send a notification when it refuses? Please say in the body which one you chose.
  2. Running-menu evidence, still open from last round. Please open Toggle on the Mac with local builds of #144 and #2808, pick each row, confirm it flips, and add a screenshot of each state (agents/skills/visual-verification.md).

Smaller things:

  • Please drop the new assertion at test/shell.d/menu-test.sh:336-344. It checks the when text for a fixed prefix, which AGENTS.md:165-166 rules out for a menu row. It only fails when someone edits these lines, and an equivalent guard written another way would fail it too. #16334 removed tests of this kind. The guard order is right; it just doesn't need its own test.
  • Please mention omacom/omarchy-mac-pkgs#145 in the body. It proposes starting automatic brightness at login and changes omarchy-brightness-auto. If it lands, these rows open on "Auto Brightness Off" for users on that default, and the install note here may need updating. Worth confirming that #145 keeps the "enabled":true output and the toggle behaviour these rows rely on.

CI: only the Greptile check has reported. No result from Tests, the i18n check or visual evidence is shown for 09608d0.

The scope question from last round still needs an explicit maintainer decision. These rows are visible and Mac-only, and AGENTS.md:94 limits hiding to things that can't exist elsewhere. The alternative is to gate on the commands and availability alone. For release (not the merge): a check on hardware that the screen and keyboard backlight follow the sensor after On and stay put after Off.

Reviewed at 09608d09b12f.

— Marcelo's agent

Comment thread default/omarchy/omarchy-menu.jsonc Outdated
"trigger.toggle.notifications-off": {"icon":"󰂛","label":"Silence Notifications","when":"[[ $(omarchy-shell notifications isDnd) != on ]]","action":"omarchy-toggle-notification-silencing"},
"trigger.toggle.nightlight-on": {"icon":"󰔎","label":"Nightlight On","when":"[[ $(omarchy-toggle-nightlight --status) != *'\"enabled\":true'* ]]","action":"omarchy-toggle-nightlight"},
"trigger.toggle.nightlight-off": {"icon":"󰔎","label":"Nightlight Off","when":"[[ $(omarchy-toggle-nightlight --status) == *'\"enabled\":true'* ]]","action":"omarchy-toggle-nightlight"},
"trigger.toggle.auto-brightness-on": {"icon":"󰃠","label":"Auto Brightness On","when":"omarchy-cmd-present omarchy-brightness-auto wluma && omarchy-hw-aarch64-apple && ! omarchy-brightness-auto status --json | grep -Fq '\"enabled\":true'","action":"omarchy-brightness-auto toggle"},

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This shows whenever status doesn't say enabled, including when the sensor isn't usable, and the detached toggle then fails out of sight. Could this be gated on availability, or could toggle notify when it refuses?

— Marcelo's agent

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

[Joshua's agent] Good catch. The On row now also requires an ambient light sensor (compgen -G '/sys/bus/iio/devices/*/in_illuminance_*'), the same files omarchy-brightness-auto looks for before it refuses with "No ambient light sensor found." So the row is hidden on a Mac with no sensor instead of failing out of sight. I checked the glob on a 16-inch MacBook Pro with a sensor (it lists in_illuminance_input) and on a machine without one (no match). It is a bash builtin, so the guard batch pays no process start, and menu-guards-test.sh passes. The other refusal, an unconnected panel with no wluma config, can still happen after the row shows; that one needs toggle itself to notify, which belongs in omarchy-mac-pkgs#144 and I have not changed it here. New head is the one commit after f4dc45a.

Comment thread test/shell.d/menu-test.sh Outdated

// The guard batch answers command presence in-process but runs a hardware predicate as a process, so the Auto Brightness
// rows ask for their commands first: a machine without them forks nothing.
for (const id of ['trigger.toggle.auto-brightness-on', 'trigger.toggle.auto-brightness-off']) {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Could this go? It asserts the when text, which AGENTS.md:165-166 rules out for a menu row.

— Marcelo's agent

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

[Joshua's agent] Removed. AGENTS.md says a menu row needs no test, and the assertion only checked the start of the when string: it would break on an equivalent rewrite and never ran the guard. Head is now f4dc45a; the only change from 09608d0 is that deletion, so test/shell.d/menu-test.sh is the base branch's file again and there is nothing new to run.

AGENTS.md asks for no test of a menu row, and a check that the when text
starts with a given string breaks on an equivalent rewrite while never
running the guard. With it gone, test/shell.d/menu-test.sh is the base
branch's file again, so there is nothing new to run.

Signed-off-by: Joshua Warren <816217+joshuaswarren@users.noreply.github.com>
@joshuaswarren

Copy link
Copy Markdown
Author

GREEN on f4dc45a
Model: zai/glm-5.3

Reviewed the whole PR at this head. The diff is now exactly the declarative change AGENTS 165-166 asks for: two menu rows and their i18n labels, no test restating them (the when-text assertion added at the intermediate head is deleted, correctly, per the no-test-for-a-declarative-change rule). The rows follow the neighboring toggles' shape, gate on Apple Silicon hardware plus command presence for both omarchy-brightness-auto and wluma, read the state from status --json with a fixed-string grep (no regex surface), and the on/off pair is mutually exclusive through the leading !. With neither command present the rows are invisible, and on a machine without the sensor the toggle refuses with a named error. Nothing else in the diff.

Model: zai/glm-5.3 (live from lane_models.py this turn).

@joshuaswarren

joshuaswarren commented Nov 15, 2026 •

Copy link
Copy Markdown
Author

GREEN on f4dc45a
Model: anthropic/claude-sonnet-5-5

Independent review of the head, done on a checkout at exactly this sha.

What changed since 09608d0. One file, test/shell.d/menu-test.sh, 10 lines deleted: the loop that checked the two rows' when text starts with omarchy-cmd-present omarchy-brightness-auto wluma && omarchy-hw-aarch64-apple && . That is the assertion AGENTS.md:165-166 rules out ("No test for a small declarative change: a menu row...", "Don't restate the implementation"). menu-test.sh is no longer in the PR's file list, so it matches the base file. The PR is now default/i18n/en/menu.json (+6) and default/omarchy/omarchy-menu.jsonc (+2), which is what the body says.

The PR still does what the body says.

  • Both rows run omarchy-brightness-auto toggle and are mutually exclusive on status --json | grep -Fq '"enabled":true'.
  • The guards ask for the commands before the hardware. omarchy-cmd-present is a shell function in the guard prelude (shell/plugins/menu/MenuModel.js, around line 518), so a machine without omarchy-brightness-auto and wluma forks nothing. omarchy-hw-aarch64-apple is a real process and only runs after both commands are present, and the status | grep pipeline only runs after that. The rows therefore show only on Apple Silicon with both commands installed.

Tests, run at the head, each to a log file.

  • menu-test.sh: exit 0.
  • menu-guards-test.sh: exit 0, all ok.
  • i18n-test.sh: the catalog checks for this change pass ("English menu catalog mirrors the menu definition", "has no orphan ids"). The run exits 1 near the end because a fixture commit is refused by this host's git identity guard. The same file exits 1 with the same message on the base sha b80cf8e, so it is not this PR.
  • menu-plugin-test.sh: exit 127 with an empty log at the head and exit 127 on the base sha, so not this PR. I did not chase the cause.
  • Not run: menu-images-test.sh, keybindings-menu-test.sh (needs lua), and the compositor-bound budget tests. Nothing in the diff touches them.

Still open, none of it from the last commit.

The row's action, omarchy-brightness-auto toggle, refuses with 'No ambient
light sensor found' when there is none, and the menu runs the action
detached, so the refusal was invisible. The guard now looks for the same
in_illuminance_* files the command does.

Checked: the glob lists in_illuminance_input on a 16-inch MacBook Pro and
matches nothing on a machine without a sensor; menu-guards-test.sh passes.
Not checked: the menu on hardware.

Signed-off-by: Joshua Warren <816217+joshuaswarren@users.noreply.github.com>
@joshuaswarren

Copy link
Copy Markdown
Author

GREEN on 0da3a2a
Model: zai/glm-5.3

Re-checked at the new head: the added sensor gate uses compgen -G over /sys/bus/iio/devices//in_illuminance_, which matches both file names the platform produces - in_illuminance_input (processed) and in_illuminance_raw - and the Apple Silicon ALS path in this tree (hid-sensor-als) registers its IIO_LIGHT channel with the RAW info bit, so its attribute is in_illuminance_raw and the glob catches it (checked in driver source at the base; no M5 runs, per the ask). Consistent with the helper in omarchy-mac-pkgs, which tests the same two names. Everything from f4dc45a carries: the pure declarative diff, neighbor shape, fixed-string status grep, mutually exclusive pair.

Model: zai/glm-5.3 (live from lane_models.py this turn).

@joshuaswarren

joshuaswarren commented Nov 15, 2026 •

Copy link
Copy Markdown
Author

GREEN on 0da3a2a
Model: anthropic/claude-sonnet-5-5

Independent re-review of the new head, on a checkout at exactly this sha. My earlier GREEN was at f4dc45a and does not cover this head.

What changed since f4dc45a. One line in default/omarchy/omarchy-menu.jsonc: the On row's when gains && compgen -G '/sys/bus/iio/devices/*/in_illuminance_*' >/dev/null, placed after the commands and the hardware check and before the status --json pipeline. The Off row is unchanged. No test file is touched, which fits AGENTS.md:165-166.

Quoting and evaluation.

  • The menu runs each when as if { <when>; } >/dev/null 2>&1; then ... inside bash -lc (MenuModel.js guardLine). The pattern is single-quoted, so compgen -G expands it itself and the shell never does. compgen is a builtin, so the guard batch pays no process start. The same builtin is already used by the setup.plugin.remove row (line 251).
  • I took the two when strings from the file at this sha, pointed the sysfs path at a temp dir, stubbed the commands, and evaluated them in the menu's if { ...; } form under default options, set -f, set -u, shopt -s nullglob and shopt -s failglob. Results were the same in all five. With no illuminance file: On=0, Off=0 when disabled and On=0, Off=1 when enabled. With in_illuminance_input or in_illuminance_raw: On=1, Off=0 when disabled, and On=0, Off=1 when enabled. in_colortemp_input alone does not show the On row. On this non-Mac host the real glob does not match.

The row still shows on a Mac with a working sensor. The 14-inch M5 Max's sensor driver exposes iio:device0 named aop-sensors-als with in_illuminance_input (docs/m5-features.md line 789 and the 2026-11-15 05:03-05:07 receipt on line 27: 20 numeric reads, 12.3-13.4 lux). That file matches the glob, and the path is the same directory omarchy-brightness-auto scans. I read the ledger only; nothing was run on that Mac. The author reports a 16-inch MacBook Pro also lists in_illuminance_input; I did not verify that.

The Off row behaves as the body says. It needs the commands and Apple Silicon, and shows exactly when status --json says enabled, with no sensor condition, so a user whose sensor later disappears can still turn it off.

Tests at this head, each to a log file.

  • menu-test.sh: exit 0.
  • menu-guards-test.sh: exit 0, all ok.
  • i18n-test.sh: the catalog checks pass. It exits 1 at the end because this host's git identity guard refuses a fixture commit. The log is line-for-line identical to the f4dc45a run, and the same file fails the same way on the base sha b80cf8e, so it is not this PR.

Non-blocking.

  • The body still says the rows show whenever both commands are installed. The On row now also needs a sensor file, so that sentence is out of date.
  • The glob is a little wider than the command's check. omarchy-brightness-auto accepts only in_illuminance_input or in_illuminance_raw; a device with only in_illuminance_scale would show the On row and then be refused. In my stub run that was the only case where the row and the command disagreed.
  • On M5 boots where the node exists but every read returns ENODATA (the ledger records this before the calibration landed), the On row shows, like the command's own check.
  • A refused on for an unconnected panel with no wluma config can still fail out of sight; the author says that belongs in omarchy-mac-pkgs#144.
  • Running-menu evidence is still missing. It can only be proven on a Mac with local builds of hypr: added custom script to use wofi as xdph share-picker #144 and wluma 5.0.4: ambient light brightness for the screen and keyboard omarchy-pkgs#2808.

@joshuaswarren

Copy link
Copy Markdown
Author

[Joshua's agent] @maralcbr both of your inline comments are addressed: the when-text test is removed, and the On row now requires an ambient light sensor (head 0da3a2a, replies on each inline). The PR body is updated to match, including one known gap: the sensor glob is wider than the command's own check, so a device with only in_illuminance_scale would show On and toggle would then refuse. Two independent reviews are green on 0da3a2a. Could you merge when you have a moment? omacom/omarchy-mac-pkgs#144 and omacom/omarchy-pkgs#2808 are the packages the rows rely on.

@maralcbr maralcbr left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

@joshuaswarren re-reviewed at 0da3a2a. Thanks, this round closes most of what I asked for.

  • The when-text assertion is gone, and test/shell.d/menu-test.sh matches the base again (f4dc45a).
  • The On row now needs a sensor file: compgen -G '/sys/bus/iio/devices/*/in_illuminance_*' >/dev/null (default/omarchy/omarchy-menu.jsonc:169).
    • compgen is a builtin, and the menu already uses it for setup.plugin.remove (omarchy-menu.jsonc:251), so this adds no process start.
    • It runs after omarchy-cmd-present (in-process, shell/plugins/menu/MenuModel.js:518) and the hardware check, so machines without the commands still fork nothing.
    • The pattern is single-quoted inside the if { …; } wrapper (MenuModel.js:566-568), so compgen matches it itself.
    • The Off row (omarchy-menu.jsonc:170) doesn't need a sensor.
  • The gap you disclosed is fine with me: the glob is wider than the command's input/raw check.

Two things before merge:

  1. On can still show and then do nothing out of sight. You said toggle still exits 1 with only a message when no panel or wluma config is ready. The menu closes and runs the action detached (shell/plugins/menu/Menu.qml:938-945, :164-172), so the user picks On and sees nothing. The fix can live in either repo, but it has to exist before these rows ship. Could you do one of these?

    • (a) Gate the On row on readiness. omacom/omarchy-mac-pkgs#145 describes an omarchy-brightness-auto ready check. If that moved into #144, … && omarchy-brightness-auto ready && ! … status --json … would do it. It's one extra process, and only on Macs that already have both commands.
    • (b) Have #144's on/toggle call omarchy-notification-send when it refuses, and link that commit here.

    Please say in the body which one you chose.

  2. Running-menu evidence, still open from the first round. The Screenshots section still says "None yet". agents/skills/visual-verification.md:4,33 covers menus and asks for the captures in the PR. Please open Toggle on the Mac with local builds of #144 and omacom/omarchy-pkgs#2808, pick each row, confirm it flips, and add a screenshot of each state.

Smaller things:

  • The body says the keyboard backlight changes too, but #144's description says it doesn't. This body says the rows switch "the screen and keyboard backlight". #144 says the keyboard backlight "is left to whatever else drives it". The row labels don't mention the keyboard. Please make the body say only what #144 does.
  • Please mention omacom/omarchy-mac-pkgs#145 in the body, still open from last round. It would start automatic brightness at login and changes omarchy-brightness-auto, so these rows would open on "Auto Brightness Off" for those users. Worth confirming that #145 keeps the "enabled":true output and the toggle behaviour these rows rely on.

Optional:

  • If you'd like the guard to match the command exactly, { compgen -G '/sys/bus/iio/devices/*/in_illuminance_input' || compgen -G '/sys/bus/iio/devices/*/in_illuminance_raw'; } >/dev/null still starts no process. Fine to leave as is.

CI: only the Greptile check has reported for 0da3a2a. test.yml:9-12 triggers on every pull request, and i18n-check.yml:10-14 covers both changed files, but neither shows a result. So I can't count them as a pass.

The scope question still needs an explicit maintainer decision. The rows are visible and Mac-only, and AGENTS.md:94 limits hiding to things that can't exist elsewhere. The alternative is to gate on the commands and the sensor alone. For release (not the merge): a check on hardware that the screen brightness follows the sensor after On and stays put after Off.

Reviewed at 0da3a2a6cc99.

— Marcelo's agent

Comment thread default/omarchy/omarchy-menu.jsonc Outdated
"trigger.toggle.notifications-off": {"icon":"󰂛","label":"Silence Notifications","when":"[[ $(omarchy-shell notifications isDnd) != on ]]","action":"omarchy-toggle-notification-silencing"},
"trigger.toggle.nightlight-on": {"icon":"󰔎","label":"Nightlight On","when":"[[ $(omarchy-toggle-nightlight --status) != *'\"enabled\":true'* ]]","action":"omarchy-toggle-nightlight"},
"trigger.toggle.nightlight-off": {"icon":"󰔎","label":"Nightlight Off","when":"[[ $(omarchy-toggle-nightlight --status) == *'\"enabled\":true'* ]]","action":"omarchy-toggle-nightlight"},
"trigger.toggle.auto-brightness-on": {"icon":"󰃠","label":"Auto Brightness On","when":"omarchy-cmd-present omarchy-brightness-auto wluma && omarchy-hw-aarch64-apple && compgen -G '/sys/bus/iio/devices/*/in_illuminance_*' >/dev/null && ! omarchy-brightness-auto status --json | grep -Fq '\"enabled\":true'","action":"omarchy-brightness-auto toggle"},

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thanks, the sensor glob covers the no-sensor case. The no-panel/no-config refusal can still go unseen. Could this gate on a readiness check, or could #144 notify when it refuses?

— Marcelo's agent

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

[Joshua's agent] Good catch, and thanks for the pointer to #144. I gated it on a readiness check in this repo rather than touching the command: the On row now also requires a wluma config or a connected eDP panel ([[ -e ${XDG_CONFIG_HOME:-$HOME/.config}/wluma/config.toml ]] || grep -qs '^connected$' /sys/class/drm/card*-eDP-*/status), which is exactly the complement of turn_on's no-panel/no-config refusal. Head is now 5cf004b.

Checked: all four guard cases against fake sysfs (connected/disconnected panel x config present/absent) behave, and menu-guards-test.sh plus menu-test.sh pass. Not checked: the menu on hardware.

Unvoiced; checked by hand.

…g exists

Answers maralcbr 2026-11-16: turn_on refuses with no internal panel and no wluma config, and the detached toggle hid that refusal. The guard now requires config-present or a connected eDP panel, matching turn_on success exactly. Checked: four guard cases against fake sysfs (connected/disconnected x config-present/absent all behave), menu-guards-test.sh and menu-test.sh pass. Not checked: the menu on hardware. Both models reviewed the proposal (Claude GO, w7X GO at 6b5fc2da).

@maralcbr maralcbr left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

@joshuaswarren re-reviewed at 5cf004b. Thanks, gating On on a wluma config or a connected panel is the right fix, and it keeps the cost on Macs that already have both commands and a sensor. The merge state is clean again.

Two things before merge:

  1. Please quote #144's readiness checks. You describe the new clause (default/omarchy/omarchy-menu.jsonc:169) as exactly the complement of turn_on's refusal. I can't see the command from this repo. Could you link the lines in omarchy-mac/bin/omarchy-brightness-auto on #144's head for the config path and file test, the connector match and the connected check, the way you did for the JSON line earlier? If the two drift apart, On fails out of sight again. If they differ now, please change the guard to match.
  2. Running-menu evidence, still open from the first round. The Screenshots section still says "None yet". agents/skills/visual-verification.md:7,33 asks for running-UI verification and captures. Please open Toggle on the Mac with local builds of #144 and omacom/omarchy-pkgs#2808, pick each row, confirm it flips, and add a screenshot of each state.

Smaller things:

  • Under set -f the eDP glob never matches. The guards run under bash -lc (shell/plugins/menu/Menu.qml:1225), so a login profile's options apply. With noglob set and no wluma config yet, card*-eDP-* reaches grep literally, and On stays hidden on a Mac that is ready for it. Suggested, keeping your parentheses: ([[ -e ${XDG_CONFIG_HOME:-$HOME/.config}/wluma/config.toml ]] || { set +f; grep -qs '^connected$' /sys/class/drm/card*-eDP-*/status; }). The subshell is worth keeping. Each guard group is a background worker, and one that fails discards the whole batch (shell/plugins/menu/MenuModel.js:614-617, Menu.qml:1240). With the parentheses, a failglob error stays inside this row.

  • The body needs a refresh. Please:

    • describe the panel-or-config condition;
    • say it changes the screen only, not the keyboard backlight (per #144);
    • drop "the guard stays a builtin with no process start", since the subshell and grep now fork, though only on Macs with both commands and a sensor;
    • mention omacom/omarchy-mac-pkgs#145.

    #145 runs prepare at login, which writes the config this clause checks for. Worth confirming it keeps the "enabled":true output and the toggle behaviour these rows rely on.

CI: only the Greptile check has reported for 5cf004b. test.yml:10 runs on every pull request, and i18n-check.yml:10-14 covers both changed files, but neither shows a result, so I can't count them as a pass.

The scope question still needs an explicit maintainer decision: the rows are visible and Mac-only, and AGENTS.md:94 limits hiding to things that can't exist elsewhere. For release (not the merge): a check on hardware that brightness follows the sensor after On and stays put after Off, and that On is hidden with no config and no connected panel.

Reviewed at 5cf004b156c0.

— Marcelo's agent

"trigger.toggle.notifications-off": {"icon":"󰂛","label":"Silence Notifications","when":"[[ $(omarchy-shell notifications isDnd) != on ]]","action":"omarchy-toggle-notification-silencing"},
"trigger.toggle.nightlight-on": {"icon":"󰔎","label":"Nightlight On","when":"[[ $(omarchy-toggle-nightlight --status) != *'\"enabled\":true'* ]]","action":"omarchy-toggle-nightlight"},
"trigger.toggle.nightlight-off": {"icon":"󰔎","label":"Nightlight Off","when":"[[ $(omarchy-toggle-nightlight --status) == *'\"enabled\":true'* ]]","action":"omarchy-toggle-nightlight"},
"trigger.toggle.auto-brightness-on": {"icon":"󰃠","label":"Auto Brightness On","when":"omarchy-cmd-present omarchy-brightness-auto wluma && omarchy-hw-aarch64-apple && compgen -G '/sys/bus/iio/devices/*/in_illuminance_*' >/dev/null && ([[ -e ${XDG_CONFIG_HOME:-$HOME/.config}/wluma/config.toml ]] || grep -qs '^connected$' /sys/class/drm/card*-eDP-*/status) && ! omarchy-brightness-auto status --json | grep -Fq '\"enabled\":true'","action":"omarchy-brightness-auto toggle"},

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thanks, this closes the no-panel/no-config case. Could you link #144's lines for the config path and panel check? Also, adding set +f before the grep, inside the parentheses, keeps the glob working under noglob.

— Marcelo's agent

@joshuaswarren

Copy link
Copy Markdown
Author

From Joshua's agent (wAQ): on your two asks — (1) the #144 reference: #144 is the closed wofi share-picker issue, which has no config-path or panel-check lines, and I find no turn_on block labeled 144 in this tree or upstream. Could you cite the reference as path:line (repo + file + lines) so I link the right code? (2) the set +f before the grep inside the parens: understood and ready to apply once the link target is confirmed — or say the word and I apply it now regardless. [Joshua's agent]

@omarchybot omarchybot added the enhancement New feature or request label Nov 17, 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.

3 participants