Switching between Speakers and Headphones
#4
I updated the script so that instead of having two separate scripts you can have just one.

audioswap.sh
Code:
#!/bin/sh
case "$1" in
    -h|--headphones|headphones|aux)
        echo "Disabling Speakers..."
        amixer -c 0 set 'Line Out'  mute
        echo "Enabling Headphones..."
        amixer -c 0 set 'Headphone' unmute
        echo "Done."
        ;;
    -s|--speakers|speakers)
        echo "Disabling Headphones..."
        amixer -c 0 set 'Headphone' mute
        echo "Enabling Speakers..."
        amixer -c 0 set 'Line Out'  unmute
        echo "Done."
        ;;
    -?|*)
        echo "Usage:"
        echo "\tSpeakers: -h | --headphones | headphones | aux"
        echo "\tHeadphones: -s | --speakers | speakers"
        echo "\tHelp: -? | *"
        ;;
esac


Messages In This Thread
RE: Switching between Speakers and Headphones - by DrewTechs - 07-28-2020, 11:44 PM

Forum Jump:


Users browsing this thread: 1 Guest(s)