I find it annoying when I forget to stop videos before closing my laptop and then having sound playing when opening it in public.
I tried to add the following script to /lib/systemd/system-sleep
:
#!/bin/bash
amixer -q -D pulse sset Master mute
echo 2 >> /home/user/test
The script seems to be called when suspending, as new lines are being appended to the test
file (twice, which might indicate that the script also runs on resume - can someone confirm this assumption?).
Either the sound system re-enables itself automatically or something else is wrong. But the amixer
command, when executed manually, works fine.
Any ideas?