Add Asus Zenbook UX3404 hotkey support #5535
Add Asus Zenbook UX3404 hotkey support #5535niraletter wants to merge 6 commits intobasecamp:devfrom
Conversation
This reverts commit fe855ec.
There was a problem hiding this comment.
Pull request overview
Adds Zenbook-specific hotkey handlers (camera toggle, fan profile cycling, mic mute) to Omarchy’s Hyprland bindings, plus installer-time sudoers setup to allow safe-ish sysfs writes needed for those toggles on supported Asus Zenbook hardware.
Changes:
- Add Zenbook camera toggle (USB unbind/bind + LED + OSD) and bind it to
XF86WebCam. - Add Zenbook fan platform profile cycler (sysfs + OSD) and bind it to
XF86Fn_F, with sudoers setup. - Add Zenbook-specific mic mute handler using
wpctl, routed via the existingomarchy-audio-input-mutedispatcher.
Tip
If you aren't ready for review, convert to a draft PR.
Click "Convert to draft" or run gh pr ready --undo.
Click "Ready for review" or run gh pr ready to reengage.
Reviewed changes
Copilot reviewed 5 out of 9 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| install/config/hardware/asus/fix-zenbook-fan-profile.sh | Adds sudoers rule to allow writing ACPI platform_profile without prompting. |
| install/config/hardware/asus/fix-zenbook-camera.sh | Adds sudoers rule to allow USB bind/unbind writes for camera toggling. |
| install/config/all.sh | Registers the new Zenbook fix scripts in the installer hardware chain. |
| default/hypr/bindings/utilities.conf | Binds XF86Fn_F to the Zenbook fan profile script. |
| default/hypr/bindings/media.conf | Binds XF86WebCam to the Zenbook camera toggle script. |
| bin/omarchy-toggle-fan-profile-zenbook | New fan profile cycling implementation using /sys/firmware/acpi/platform_profile. |
| bin/omarchy-toggle-camera-zenbook | New camera toggle implementation using USB unbind/bind + asus::camera LED + OSD. |
| bin/omarchy-audio-input-mute-zenbook | New Zenbook mic mute implementation using wpctl + OSD. |
| bin/omarchy-audio-input-mute | Extends dispatch chain to route Zenbook mic mute to the new handler. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Pull request overview
Adds Asus Zenbook-specific hotkey handling to Omarchy (camera toggle, fan profile cycling, and a Zenbook mic-mute handler) and wires these into the default Hyprland keybindings, with install-time sudoers setup for passwordless sysfs operations on matching hardware.
Changes:
- Add Zenbook camera toggle (USB bind/unbind) with install-time sudo helper + sudoers rule.
- Add Zenbook fan profile cycler (ACPI
platform_profile) with sudoers rule and keybinding. - Add Zenbook mic mute implementation using
wpctl, routed via the existingomarchy-audio-input-mutedispatcher.
Reviewed changes
Copilot reviewed 5 out of 9 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
install/config/hardware/asus/fix-zenbook-fan-profile.sh |
Installs a sudoers rule enabling passwordless writes to platform_profile on Zenbook systems. |
install/config/hardware/asus/fix-zenbook-camera.sh |
Installs a root-owned helper and sudoers rule intended to enable passwordless camera USB bind/unbind on Zenbooks. |
install/config/all.sh |
Registers the two new Zenbook install-time fix scripts in the Asus hardware chain. |
default/hypr/bindings/utilities.conf |
Adds a default keybinding for fan profile cycling (XF86Fn_F). |
default/hypr/bindings/media.conf |
Adds a default keybinding for camera toggle (XF86WebCam). |
bin/omarchy-toggle-fan-profile-zenbook |
Implements profile cycling with OSD feedback by writing to platform_profile. |
bin/omarchy-toggle-camera-zenbook |
Implements USB unbind/bind camera toggle with LED + OSD feedback. |
bin/omarchy-audio-input-mute-zenbook |
Implements Zenbook mic mute toggle using wpctl + OSD feedback. |
bin/omarchy-audio-input-mute |
Adds Zenbook routing to the mic-mute dispatcher chain. |
[!TIP]
If you aren't ready for review, convert to a draft PR.
Click "Convert to draft" or rungh pr ready --undo.
Click "Ready for review" or rungh pr readyto reengage.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| case "$device_id" in | ||
| 1-8) | ||
| ;; | ||
| *) | ||
| echo "Refusing to ${action} unexpected USB device id: ${device_id}" >&2 | ||
| exit 1 | ||
| ;; | ||
| esac |
| bindld = , XF86PowerOff, Power menu, exec, omarchy-menu system | ||
| bindd = SUPER, K, Show key bindings, exec, omarchy-menu-keybindings | ||
| bindd = , XF86Calculator, Calculator, exec, gnome-calculator | ||
| bindld = , XF86Fn_F, Cycle fan profile, exec, omarchy-toggle-fan-profile-zenbook |
There was a problem hiding this comment.
Pull request overview
Tip
If you aren't ready for review, convert to a draft PR.
Click "Convert to draft" or run gh pr ready --undo.
Click "Ready for review" or run gh pr ready to reengage.
Adds Zenbook-specific hotkey handling to the Omarchy Hyprland defaults and installer hardware-fix chain, including sudoers rules/wrappers to safely perform privileged sysfs operations for camera and fan profile toggles.
Changes:
- Add Zenbook camera hotkey toggle (USB bind/unbind + LED sync + OSD) and an installer-provisioned root wrapper + sudoers entry.
- Add Zenbook fan profile hotkey toggle (ACPI
platform_profilecycling + OSD) and an installer-provisioned sudoers entry. - Add Zenbook-specific mic mute handling using
wpctl, routed via the existingomarchy-audio-input-mutedispatcher.
Reviewed changes
Copilot reviewed 5 out of 9 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| install/config/hardware/asus/fix-zenbook-fan-profile.sh | Adds Zenbook-only sudoers entry to allow writing platform_profile via tee. |
| install/config/hardware/asus/fix-zenbook-camera.sh | Installs a root-owned USB bind/unbind wrapper and corresponding sudoers entry (Zenbook-only). |
| install/config/all.sh | Registers the new Zenbook hardware fix scripts in the ASUS install chain. |
| default/hypr/bindings/utilities.conf | Binds XF86Fn_F to fan profile cycling script. |
| default/hypr/bindings/media.conf | Binds XF86WebCam to the Zenbook camera toggle (guarded by hardware match). |
| bin/omarchy-toggle-fan-profile-zenbook | Implements platform profile cycling with OSD feedback. |
| bin/omarchy-toggle-camera-zenbook | Implements camera USB unbind/bind toggle with LED + OSD. |
| bin/omarchy-audio-input-mute-zenbook | Implements Zenbook mic mute toggle via wpctl with OSD feedback. |
| bin/omarchy-audio-input-mute | Routes Zenbook mic mute hotkey to the new Zenbook handler. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| bindld = , XF86PowerOff, Power menu, exec, omarchy-menu system | ||
| bindd = SUPER, K, Show key bindings, exec, omarchy-menu-keybindings | ||
| bindd = , XF86Calculator, Calculator, exec, gnome-calculator | ||
| bindld = , XF86Fn_F, Cycle fan profile, exec, omarchy-toggle-fan-profile-zenbook |
| case "$device_id" in | ||
| 1-8) | ||
| ;; | ||
| *) | ||
| echo "Refusing to ${action} unexpected USB device id: ${device_id}" >&2 | ||
| exit 1 | ||
| ;; | ||
| esac |
88bd60f to
44b3265
Compare
44b3265 to
a981720
Compare
|
closing this, bind/unbind is not needed, there is much simpler approach |
|
mic-mute sorted 241145f |
Summary
Adds fix/support for hardware hotkeys on Asus Zenbook machines (especially UX3404 model also should work on all zenbook lineups having the hotkeys).
PR includes:
XF86WebCam- USB unbind/bind with hardware LED syncXF86Fn_F- ACPI platform_profile rotationwpctlfor reliable audio source toggling. Hardware LED syncs by defaultAll three feature swayosd notifications showing current state with appropriate system icons.
Detailed Changes
Camera Toggle (XF86WebCam)
Problem: A lot of Asus Zenbook devices ship with a dedicated camera toggle hotkey (
XF86WebCam) that had no binding and did nothing.Solution: Physical USB device unbind/bind to fully disconnect the internal webcam, with hardware LED sync and OSD feedback.
bin/omarchy-toggle-camera-zenbook(new)3-8at/sys/bus/usb/drivers/usb/3-8asus::camera) viabrightnessctl- sets to 0 when camera is active, 1 when disabledinstall/config/hardware/asus/fix-zenbook-camera.sh(new)omarchy-hw-match "Zenbook"- only runs on Zenbook hardwaredefault/hypr/bindings/media.conf(modified)bindld = ,XF86WebCam, Toggle camera, exec, omarchy-toggle-camera-zenbookinstall/config/all.sh(modified)fix-zenbook-camera.shin the ASUS hardware install chainFan Profile Cycling (XF86Fn_F)
Problem: Zenbook laptops have a dedicated fan profile hotkey (
XF86Fn_F) that was unbound.Solution: Cycle through ACPI platform profiles directly via sysfs with OSD showing current mode.
bin/omarchy-toggle-fan-profile-zenbook(new)/sys/firmware/acpi/platform_profilequiet-balanced-performance-quietbalancedfor unknown statesinstall/config/hardware/asus/fix-zenbook-fan-profile.sh(new)omarchy-hw-match "Zenbook"/etc/sudoers.d/omarchy-zenbook-fan-profilewith NOPASSWD rule for/usr/bin/tee /sys/firmware/acpi/platform_profile440default/hypr/bindings/utilities.conf(modified)bindld = , XF86Fn_F, Cycle fan profile, exec, omarchy-toggle-fan-profile-zenbookinstall/config/all.sh(modified)fix-zenbook-fan-profile.shin the ASUS hardware install chainMic Toggle Fix
Problem: The default mic toggle handler (
omarchy-swayosd-client --input-volume mute-toggle) did not work correctly on Zenbook hardware (esp. UX3404)Solution: Usess
wpctlhandler for reliable microphone mute toggling. Hardware LED syncs by defaultbin/omarchy-audio-input-mute-zenbook(new)wpctl set-mute @DEFAULT_AUDIO_SOURCE@ togglefor reliable toggling"Microphone muted"/"Microphone on"and corresponding iconsbin/omarchy-audio-input-mute(modified)omarchy-audio-input-mute-zenbookon Zenbook systems