March 23, 2016

I recently acquired a used Lenovo X220 for use as a linux laptop, and needed the following in my openbox configuration XML to make the hardware speaker and mic mute buttons work:

  <!-- Modified for X220 -->
<keybind key="XF86AudioMute">
<action name="Execute">
<command>pactl set-sink-mute 0 toggle</command>
</action>
</keybind>
<keybind key="XF86AudioMicMute">
<action name="Execute">
<command>pactl set-source-mute 1 toggle</command>
</action>
</keybind>


Sources and sinks can be discovered using:

pactl list sources
pactl list sinks


For me there was only one sink, and two sources, the first of which is some kind of virtual source that monitors the microphone, while the second source is the microphone itself.

Something that is interesting is that both speaker and mic mute buttons have a central light that lights up when mute is active, and this seems tied to the hardware. This makes me trust that when the mute buttons are used they actually do something.

Hope this helps some people.