Created
January 29, 2019 07:17
-
-
Save nerevar009/12e534aa7d9591989094cc4ee532739b 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/bash | |
setsinkport () { | |
if [ $(</var/log/headphones_plugged) == 1 ] | |
then | |
pactl set-sink-port @DEFAULT_SINK@ "[Out] Headphones" | |
else | |
pactl set-sink-port @DEFAULT_SINK@ "[Out] Speaker" | |
fi | |
} | |
setsinkport | |
while inotifywait -e close_write /var/log/headphones_plugged; do | |
setsinkport | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment