diff --git a/bin/omarchy-cmd-mic-mute b/bin/omarchy-cmd-mic-mute index a1a76cec..3931d0b8 100755 --- a/bin/omarchy-cmd-mic-mute +++ b/bin/omarchy-cmd-mic-mute @@ -1,9 +1,11 @@ #!/bin/bash -# Toggle microphone mute. Dell XPS systems get special handling for the hardware LED. +# Toggle microphone mute. Dell XPS and ThinkPad systems get special handling for the hardware LED. if omarchy-hw-match "XPS"; then omarchy-cmd-mic-mute-xps +elif omarchy-hw-match "ThinkPad"; then + omarchy-cmd-mic-mute-thinkpad else omarchy-swayosd-client --input-volume mute-toggle fi diff --git a/bin/omarchy-cmd-mic-mute-thinkpad b/bin/omarchy-cmd-mic-mute-thinkpad new file mode 100755 index 00000000..a6e551a7 --- /dev/null +++ b/bin/omarchy-cmd-mic-mute-thinkpad @@ -0,0 +1,23 @@ +#!/bin/bash + +# Toggle microphone mute on ThinkPad systems. Uses wpctl for reliable toggling +# and syncs the platform::micmute LED via brightnessctl. + +wpctl set-mute @DEFAULT_AUDIO_SOURCE@ toggle >/dev/null + +if pactl get-source-mute @DEFAULT_SOURCE@ | grep -q 'yes'; then + osd_message='Microphone muted' + osd_icon='microphone-sensitivity-muted-symbolic' + led_value=1 +else + osd_message='Microphone on' + osd_icon='audio-input-microphone-symbolic' + led_value=0 +fi + +brightnessctl --device="platform::micmute" set "$led_value" >/dev/null 2>&1 || true + +swayosd-client \ + --monitor "$(omarchy-hyprland-monitor-focused)" \ + --custom-message "$osd_message" \ + --custom-icon "$osd_icon" diff --git a/bin/omarchy-hw-match b/bin/omarchy-hw-match index ae3eb44d..c27875fa 100755 --- a/bin/omarchy-hw-match +++ b/bin/omarchy-hw-match @@ -1,6 +1,7 @@ #!/bin/bash -# Match against the computer's DMI product name (case-insensitive). -# Usage: omarchy-hw-match "XPS" +# Match against the computer's DMI product name or product family (case-insensitive). +# Usage: omarchy-hw-match "XPS" or omarchy-hw-match "ThinkPad" -grep -qi "$1" /sys/class/dmi/id/product_name 2>/dev/null +grep -qi "$1" /sys/class/dmi/id/product_name 2>/dev/null || +grep -qi "$1" /sys/class/dmi/id/product_family 2>/dev/null