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.

14 lines
361 B

#!/usr/bin/env sh
${SPEAKER:-"Line Out"}
${HEADPHONE:-"Headphone"}
${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