Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on Apr 14th, 2012  |  syntax: Bash  |  size: 0.34 KB  |  hits: 37  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. #!/bin/sh
  2.  
  3. CUR_OUTPUT=$(amixer cget numid=3 | tail -n1 | sed -e "s/[^[0-9]]*//g")
  4.  
  5. NEW_OUTPUT=$(zenity --list --title="Choose audio output (currently $CUR_OUTPUT)" \
  6.   --column="Setting" --column="Description" \
  7.   0 "Auto" \
  8.   1 "Audio jack" \
  9.   2 "HDMI passthrough")
  10. RET=$?
  11.  
  12. if [ $RET -eq 0 ]; then
  13.   amixer cset numid=3 $NEW_OUTPUT
  14. fi