Skip to content
Open
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions default/i18n/en/menu.json
Original file line number Diff line number Diff line change
Expand Up @@ -315,6 +315,12 @@
"trigger.toggle.nightlight-off": {
"label": "Nightlight Off"
},
"trigger.toggle.auto-brightness-on": {
"label": "Auto Brightness On"
},
"trigger.toggle.auto-brightness-off": {
"label": "Auto Brightness Off"
},
"trigger.toggle.screensaver-on": {
"label": "Screensaver On"
},
Expand Down
2 changes: 2 additions & 0 deletions default/omarchy/omarchy-menu.jsonc
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,8 @@
"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.

"trigger.toggle.auto-brightness-off": {"icon":"󰃠","label":"Auto Brightness Off","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"},
"trigger.toggle.screensaver-on": {"icon":"󱄄","label":"Screensaver On","when":"omarchy-toggle-enabled screensaver-off","action":"omarchy-toggle-screensaver"},
"trigger.toggle.screensaver-off": {"icon":"󱄄","label":"Screensaver Off","when":"! omarchy-toggle-enabled screensaver-off","action":"omarchy-toggle-screensaver"},
"trigger.toggle.crash-capture-on": {"icon":"󱚡","label":"Crash Capture On","when":"omarchy-toggle-enabled crash-capture-off","action":"omarchy-toggle-crash-capture"},
Expand Down