Last active
July 11, 2022 21:06
-
-
Save auroracramer/1f2801581a112e3a64159ef2456bada8 to your computer and use it in GitHub Desktop.
Startup script muting audio when you plug/unplug headphones so you don't blow out your eardrums
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 | |
acpi_listen | while IFS= read -r line; do | |
if [ "$line" = "jack/headphone HEADPHONE plug" ] | |
then | |
pactl -- set-sink-volume 0 20% | |
amixer -D pulse set Master mute | |
elif [ "$line" = "jack/headphone HEADPHONE unplug" ] | |
then | |
pactl -- set-sink-volume 0 20% | |
amixer -D pulse set Master mute | |
fi | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment