Hide menu submenus when none of their children are visible
Static submenus and links now inherit visibility from their descendants, so hardware sections like Touchpad Haptics disappear on machines without the hardware instead of opening empty. Laptop Display and Mirror Display are guarded by omarchy-hw-laptop. The guard evaluator brace-wraps every when/checked condition before silencing it, so conditions in the jsonc no longer need their own >/dev/null plumbing, and parents no longer need to repeat their children's guards. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Fable 5
parent
9d3cb70ee7
commit
2bf4f4a9fb
@@ -14,13 +14,13 @@
|
||||
// checked shell condition; append ✓ when it succeeds
|
||||
|
||||
// Root Menu
|
||||
"apps": {"icon":"","label":"Apps","aliases":["app","applications"],"keywords":"","action":"omarchy-shell shell summon omarchy.launcher"},
|
||||
"apps": {"icon":"","label":"Apps","aliases":["app","applications"],"action":"omarchy-shell shell summon omarchy.launcher"},
|
||||
"learn": {"icon":"","label":"Learn","keywords":"manual docs help"},
|
||||
"trigger": {"icon":"","label":"Trigger","keywords":""},
|
||||
"style": {"icon":"","label":"Style","keywords":""},
|
||||
"setup": {"icon":"","label":"Setup","aliases":["settings"],"keywords":""},
|
||||
"install": {"icon":"","label":"Install","keywords":""},
|
||||
"remove": {"icon":"","label":"Remove","aliases":["uninstall"],"keywords":""},
|
||||
"trigger": {"icon":"","label":"Trigger"},
|
||||
"style": {"icon":"","label":"Style"},
|
||||
"setup": {"icon":"","label":"Setup","aliases":["settings"]},
|
||||
"install": {"icon":"","label":"Install"},
|
||||
"remove": {"icon":"","label":"Remove","aliases":["uninstall"]},
|
||||
"update": {"icon":"","label":"Update","aliases":["restart","refresh"],"keywords":"upgrade channel firmware timezone"},
|
||||
"about": {"icon":"","label":"About","keywords":"omarchy system information","action":"omarchy-launch-about"},
|
||||
"system": {"icon":"","label":"System","aliases":["power-menu"],"keywords":"lock logout reboot shutdown suspend hibernate"},
|
||||
@@ -47,7 +47,7 @@
|
||||
"trigger.reminder": {"icon":"","label":"Reminder","aliases":["reminder"],"keywords":"timer notification remind"},
|
||||
"trigger.capture": {"icon":"","label":"Capture","aliases":["capture","screenshot","screenrecord","screen-record","screenrecording"],"keywords":"color text extraction"},
|
||||
"trigger.capture.screenshot": {"icon":"","label":"Screenshot","keywords":"picture","action":"omarchy-capture-screenshot"},
|
||||
"trigger.capture.screenrecord.stop": {"icon":"","label":"Stop Screenrecording","keywords":"recording video","when":"pgrep -f '^gpu-screen-recorder' >/dev/null","action":"omarchy-capture-screenrecording --stop-recording"},
|
||||
"trigger.capture.screenrecord.stop": {"icon":"","label":"Stop Screenrecording","keywords":"recording video","when":"pgrep -f '^gpu-screen-recorder'","action":"omarchy-capture-screenrecording --stop-recording"},
|
||||
"trigger.capture.screenrecord": {"icon":"","label":"Screenrecord","keywords":"record screen video"},
|
||||
"trigger.capture.text": {"icon":"","label":"Text","keywords":"ocr text extraction","action":"omarchy-capture-text"},
|
||||
"trigger.capture.color": {"icon":"","label":"Color","keywords":"picker hyprpicker","action":"pkill hyprpicker || hyprpicker -a"},
|
||||
@@ -59,15 +59,15 @@
|
||||
"trigger.share": {"icon":"","label":"Share","aliases":["share"],"keywords":"clipboard file folder localsend"},
|
||||
"trigger.toggle": {"icon":"","label":"Toggle","aliases":["toggle","toggles"],"keywords":"screensaver nightlight idle notifications bar quickshell"},
|
||||
"trigger.hardware": {"icon":"","label":"Hardware","aliases":["hardware","hw"],"keywords":"monitor touchpad touchscreen gpu"},
|
||||
"trigger.hardware.laptop-display": {"icon":"","label":"Laptop Display","keywords":"monitor","action":"omarchy-hyprland-monitor-internal toggle"},
|
||||
"trigger.hardware.mirror-display": {"icon":"","label":"Mirror Display","keywords":"monitor","action":"omarchy-hyprland-monitor-internal-mirror toggle"},
|
||||
"trigger.hardware.hybrid-gpu": {"icon":"","label":"Hybrid GPU","keywords":"graphics","when":"omarchy-hw-hybrid-gpu >/dev/null","action":"omarchy-launch-floating-terminal-with-presentation omarchy-toggle-hybrid-gpu"},
|
||||
"trigger.hardware.touchpad": {"icon":"","label":"Touchpad","keywords":"trackpad","when":"omarchy-hw-touchpad >/dev/null","action":"omarchy-toggle-touchpad"},
|
||||
"trigger.hardware.touchpad-haptics": {"icon":"","label":"Touchpad Haptics","when":"omarchy-hw-dell-xps-haptic-touchpad >/dev/null && omarchy-cmd-present dell-xps-touchpad-haptics"},
|
||||
"trigger.hardware.touchpad-haptics.low": {"icon":"","label":"low","when":"omarchy-hw-dell-xps-haptic-touchpad >/dev/null && omarchy-cmd-present dell-xps-touchpad-haptics","checked":"[[ \"$(dell-xps-touchpad-haptics get)\" == \"low\" ]]","action":"dell-xps-touchpad-haptics set low"},
|
||||
"trigger.hardware.touchpad-haptics.mid": {"icon":"","label":"mid","keywords":"medium","when":"omarchy-hw-dell-xps-haptic-touchpad >/dev/null && omarchy-cmd-present dell-xps-touchpad-haptics","checked":"[[ \"$(dell-xps-touchpad-haptics get)\" == \"mid\" ]]","action":"dell-xps-touchpad-haptics set mid"},
|
||||
"trigger.hardware.touchpad-haptics.high": {"icon":"","label":"high","when":"omarchy-hw-dell-xps-haptic-touchpad >/dev/null && omarchy-cmd-present dell-xps-touchpad-haptics","checked":"[[ \"$(dell-xps-touchpad-haptics get)\" == \"high\" ]]","action":"dell-xps-touchpad-haptics set high"},
|
||||
"trigger.hardware.touchscreen": {"icon":"","label":"Touchscreen","keywords":"tablet","when":"omarchy-hw-touchscreen >/dev/null","action":"omarchy-toggle-touchscreen"},
|
||||
"trigger.hardware.laptop-display": {"icon":"","label":"Laptop Display","keywords":"monitor","when":"omarchy-hw-laptop","action":"omarchy-hyprland-monitor-internal toggle"},
|
||||
"trigger.hardware.mirror-display": {"icon":"","label":"Mirror Display","keywords":"monitor","when":"omarchy-hw-laptop","action":"omarchy-hyprland-monitor-internal-mirror toggle"},
|
||||
"trigger.hardware.hybrid-gpu": {"icon":"","label":"Hybrid GPU","keywords":"graphics","when":"omarchy-hw-hybrid-gpu","action":"omarchy-launch-floating-terminal-with-presentation omarchy-toggle-hybrid-gpu"},
|
||||
"trigger.hardware.touchpad": {"icon":"","label":"Touchpad","keywords":"trackpad","when":"omarchy-hw-touchpad","action":"omarchy-toggle-touchpad"},
|
||||
"trigger.hardware.touchpad-haptics": {"icon":"","label":"Touchpad Haptics"},
|
||||
"trigger.hardware.touchpad-haptics.low": {"icon":"","label":"low","when":"omarchy-hw-dell-xps-haptic-touchpad && omarchy-cmd-present dell-xps-touchpad-haptics","checked":"[[ \"$(dell-xps-touchpad-haptics get)\" == \"low\" ]]","action":"dell-xps-touchpad-haptics set low"},
|
||||
"trigger.hardware.touchpad-haptics.mid": {"icon":"","label":"mid","keywords":"medium","when":"omarchy-hw-dell-xps-haptic-touchpad && omarchy-cmd-present dell-xps-touchpad-haptics","checked":"[[ \"$(dell-xps-touchpad-haptics get)\" == \"mid\" ]]","action":"dell-xps-touchpad-haptics set mid"},
|
||||
"trigger.hardware.touchpad-haptics.high": {"icon":"","label":"high","when":"omarchy-hw-dell-xps-haptic-touchpad && omarchy-cmd-present dell-xps-touchpad-haptics","checked":"[[ \"$(dell-xps-touchpad-haptics get)\" == \"high\" ]]","action":"dell-xps-touchpad-haptics set high"},
|
||||
"trigger.hardware.touchscreen": {"icon":"","label":"Touchscreen","keywords":"tablet","when":"omarchy-hw-touchscreen","action":"omarchy-toggle-touchscreen"},
|
||||
"trigger.reminder.set": {"icon":"","label":"Set one","aliases":["reminder-set","remind"],"keywords":"timer","action":"omarchy-reminder -i"},
|
||||
"trigger.reminder.show": {"icon":"","label":"Show all","keywords":"list","action":"omarchy-reminder show"},
|
||||
"trigger.reminder.clear": {"icon":"","label":"Clear all","keywords":"delete","action":"omarchy-reminder clear"},
|
||||
@@ -83,6 +83,7 @@
|
||||
"trigger.toggle.workspace-layout": {"icon":"","label":"Workspace Layout","action":"omarchy-hyprland-workspace-layout-toggle"},
|
||||
"trigger.toggle.window-gaps": {"icon":"","label":"Window Gaps","action":"omarchy-hyprland-window-gaps-toggle"},
|
||||
"trigger.toggle.one-window-ratio": {"icon":"","label":"1-Window Ratio","keywords":"square","action":"omarchy-hyprland-window-single-square-aspect-toggle"},
|
||||
|
||||
// Style
|
||||
"style.theme": {"icon":"","label":"Theme","aliases":["theme","themes"],"keywords":"colors","action":"theme=$(omarchy-theme-switcher); [[ -n $theme ]] && omarchy-theme-set \"$theme\""},
|
||||
"style.background": {"icon":"","label":"Background","aliases":["background","wallpaper"],"action":"background=$(omarchy-theme-bg-switcher); [[ -n $background ]] && omarchy-theme-bg-set \"$background\""},
|
||||
@@ -236,7 +237,7 @@
|
||||
"remove.browser": {"icon":"","label":"Browser","keywords":"uninstall"},
|
||||
"remove.dictation": {"icon":"","label":"Dictation","keywords":"uninstall voice","action":"omarchy-launch-floating-terminal-with-presentation omarchy-voxtype-remove"},
|
||||
"remove.gaming": {"icon":"","label":"Gaming","keywords":"uninstall steam retroarch minecraft"},
|
||||
"remove.service": {"icon":"","label":"Services","keywords":"uninstall dropbox tailscale vpn","when":"omarchy-pkg-present dropbox || omarchy-pkg-present tailscale"},
|
||||
"remove.service": {"icon":"","label":"Services","keywords":"uninstall dropbox tailscale vpn"},
|
||||
"remove.windows": {"icon":"","label":"Windows","keywords":"uninstall vm","action":"omarchy-launch-floating-terminal-with-presentation 'omarchy-windows-vm remove'"},
|
||||
"remove.preinstalls": {"icon":"","label":"Preinstalls","action":"omarchy-launch-floating-terminal-with-presentation omarchy-remove-preinstalls"},
|
||||
"remove.security": {"icon":"","label":"Security","keywords":"fingerprint fido2 ssh sshd"},
|
||||
|
||||
Reference in New Issue
Block a user