You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

13 lines
388 B

#!/usr/bin/env sh
SPEAKER=${SPEAKER:-"Line Out"}
HEADPHONE=${HEADPHONE:-"Headphone"}
EARPIECE=${EARPIECE:-"Earpiece"}
audiodevice() {
amixer sget "$EARPIECE" | grep -qE '\[on\]' && echo "$EARPIECE" && return
amixer sget "$HEADPHONE" | grep -qE '\[on\]' && echo "$HEADPHONE" && return
amixer sget "$SPEAKER" | grep -qE '\[on\]' && echo "$SPEAKER" && return
echo "None"
}
audiodevice