Last active
February 2, 2018 16:28
-
-
Save rogerzanoni/4e83a70a29dc26ad5bf946ad0c2d35fc to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
acpi_listen | while IFS= read line | |
do | |
if [ "$line" == "jack/headphone HEADPHONE plug" ]; then | |
echo "Headphone plugged, muting HDMI output..." | |
amixer -c 0 -d 3 set Master mute | |
elif [ "$line" == "jack/headphone HEADPHONE unplug" ]; then | |
echo "Headphone unplugged, turning HDMI output on..." | |
amixer -c 0 -d 3 set Master unmute | |
elif [ "$line" == "jack/lineout LINEOUT plug" ]; then | |
echo "HDMI output plugged, muting jack output..." | |
amixer -c 0 -d 0 set Master mute | |
elif [ "$line" == "jack/lineout LINEOUT unplug" ]; then | |
echo "HDMI output unplugged, turning headphone output on..." | |
amixer -c 0 -d 0 set Master unmute | |
fi | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment