feat(hardware): sync ThinkBook mute LEDs with WirePlumber state#5431
feat(hardware): sync ThinkBook mute LEDs with WirePlumber state#5431Dev-solder124 wants to merge 1 commit intobasecamp:devfrom
Conversation
There was a problem hiding this comment.
Pull request overview
This PR adds Lenovo ThinkBook-specific glue to keep the platform::mute / platform::micmute hardware LEDs in sync with the current WirePlumber mute state, while also adjusting mic-mute handling to preserve SwayOSD’s native input-level bar (notably for ThinkPad/ThinkBook).
Changes:
- Install + migrate a ThinkBook udev rule to allow user-level writes to the platform mute LED brightness sysfs nodes.
- Add ThinkBook-specific mic-mute handler and wrap global speaker mute to additionally update the ThinkBook LED.
- Update ThinkPad mic-mute handling to use
wpctl+ trigger SwayOSD native OSD via--input-volume +0.
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 4 out of 9 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| migrations/1777020424.sh | Migration to install ThinkBook LED udev rule and reload/trigger udev. |
| install/config/hardware/lenovo/fix-thinkbook-led-permissions.sh | Installer-time setup of ThinkBook LED udev rule. |
| install/config/all.sh | Ensures the ThinkBook LED permission fix runs during install config. |
| default/hypr/bindings/media.conf | Routes speaker mute keybinding through the new wrapper command. |
| bin/omarchy-hw-thinkbook | Adds a ThinkBook hardware detection helper. |
| bin/omarchy-cmd-mute | Wraps speaker mute toggle and syncs ThinkBook platform::mute LED. |
| bin/omarchy-cmd-mic-mute-thinkpad | Uses wpctl toggle + native SwayOSD bar trigger; syncs ThinkPad mic LED. |
| bin/omarchy-cmd-mic-mute-thinkbook | New ThinkBook mic mute toggle + LED sync + native SwayOSD bar trigger. |
| bin/omarchy-cmd-mic-mute | Routes mic-mute handling to ThinkBook-specific implementation when detected. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
18e21ed to
6a21d1c
Compare
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 4 out of 9 changed files in this pull request and generated 1 comment.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- Added udev rule to allow user control over ThinkBook `platform::mute` and `platform::micmute` LEDs - Added `omarchy-hw-thinkbook` hardware detection script - Hooked mic mute dispatch to new `omarchy-cmd-mic-mute-thinkbook` - Wrapped speaker mute with `omarchy-cmd-mute` to sync platform::mute LED - Fixed swayosd OSD on ThinkPad and ThinkBook scripts to preserve native mic-level progress bar using `--input-volume +0` while relying on `wpctl` for the toggle - Added migration script to deploy udev rule to existing installations
6a21d1c to
d667c32
Compare
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 4 out of 9 changed files in this pull request and generated 1 comment.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Description
This PR bridges the gap between WirePlumber's software audio state and the physical hardware LEDs (
platform::muteandplatform::micmute) on Lenovo ThinkBook laptops, ensuring that pressing the hardware mute keys accurately toggles the built-in LED indicators.Previously, ThinkBook users fell through to the generic mute path, resulting in no LED feedback, and the generic swayosd implementation had some limitations regarding accurate visual feedback on mute states.
What's Changed
udevrule (99-lenovo-thinkbook-leds.rules) to grant users in thevideogroup write permissions (0664) to the/sys/class/leds/platform::muteandplatform::micmutebrightness nodes.omarchy-hw-thinkbookhardware detection script (matching via DMIproduct_family).omarchy-cmd-mic-mute-thinkbookto intercept mic mute events and accurately sync theplatform::micmuteLED.XF86AudioMute) viaomarchy-cmd-muteto sync theplatform::muteLED for ThinkBooks (acts as a safe no-op on other hardware).swayosdmic-level progress bar was lost during toggling.wpctlfor reliable, synchronous muting, while triggeringomarchy-swayosd-client --input-volume +0. This preserves the native OSD mic-level bar while accurately updating the LED and audio state.1777020424.sh) so existing ThinkBook users receive the necessaryudevrules without needing a clean install.Motivation and Context
Without this change, ThinkBook users receive no physical LED feedback when muting their microphone or speakers. Additionally, it resolves a visual regression in the OSD where custom icons were replacing the native SwayOSD volume progress bars for microphone muting on ThinkPads.
Verification
udevrule correctly applies0664permissions andvideogroup ownership toplatform::muteandplatform::micmute.omarchy-hw-match "ThinkBook"correctly identifies hardware.Fn+F1) successfully toggles WirePlumber state, syncs the LED, and triggers the SwayOSD native level bar.Fn+F4) successfully toggles WirePlumber state, syncs the LED, and triggers the SwayOSD popup.