Skip to content

Instantly share code, notes, and snippets.

@lukas2511
Created April 2, 2013 09:43
Show Gist options
  • Save lukas2511/5291098 to your computer and use it in GitHub Desktop.
Save lukas2511/5291098 to your computer and use it in GitHub Desktop.
ich präsentiere ihnen: frickel. lenovo l430 series 3 dock audio foo. dislike.
current=$(pactl list | grep Active\ Port\:\ analog\-output | awk '{print $3}')
headphone=$(pactl list | grep analog-output-headphones | grep available | head -n1 | awk '{print $5}' | cut -d')' -f1)
if [ "$current" = "analog-output-headphones" ]
then
pactl set-sink-port 0 analog-output-speaker
sudo hda-verb /dev/snd/hwC0D0 0x01b SET_PIN_WIDGET_CONTROL 0x00
if [ "$headphone" = "not" ]
then
sudo hda-verb /dev/snd/hwC0D0 0x014 SET_PIN_WIDGET_CONTROL 0x40
fi
else
pactl set-sink-port 0 analog-output-headphones
sudo hda-verb /dev/snd/hwC0D0 0x01b SET_PIN_WIDGET_CONTROL 0x40
sudo hda-verb /dev/snd/hwC0D0 0x014 SET_PIN_WIDGET_CONTROL 0x00
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment