Sample Header Ad - 728x90

How do I actually write acpid event scripts that detect when headphones are plugged in?

2 votes
1 answer
712 views
I'm using acpid to detect when my headphones are plugged in. According to acpid_listen, the relevant events are jack/headphone HEADPHONE unplug jack/headphone HEADPHONE plug I created the file /etc/acpi/events/headphone_jack like this: event=jack/headphone.* action=/etc/acpi/actions/headphone.sh "%e" The event still doesn't trigger if I use jack[ /]headphone instead. The script /etc/acpi/actions/headphone.sh looks like this: amixer set Master off In other words, every time the headphones are plugged in or unplugged, the volume is muted. This amixer command works in the terminal. I restarted the acpid service with sudo /etc/init.d/acpid reload, but the event still isn't triggering. What am I doing wrong? I'm using Debian 10 ("buster") x64 on a Thinkpad X1 Carbon 4th generation.
Asked by Michael A (1713 rep)
Dec 28, 2019, 09:36 PM
Last activity: Jan 3, 2020, 11:18 PM