I want to make my speakers and headphone jack automatically mute when I return from hibernation/suspend, or maybe mute right before I hibernate/suspend. Now I could write a script to do that, but I know there are many ways I could go about doing that, however is there a right way to write this script and where would be the right place to put it compared to a basic work around that does not get the the deep system level where this script should reside.
So, your script should be placed in this directory, to be called on these events. The first argument to the script (ie, in
As for the muting itself: I'd suggest using
Alternatively, you can use
— however, the arguments to amixer will depend on your specific sound hardware configuration.