I updated the script so that instead of having two separate scripts you can have just one.
audioswap.sh
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