1

I am wanting to make my laptop mute its sound when I suspend, as well as hibernate. I have attempted this by writing a simple script and placing it in my /etc/pm/sleep.d folder and making the script executable. However when I suspend my laptop nothing happens. Can someone tell me what I need to do to make this goal of mine to work?

#!/bin/bash
#script to make  system mute sound on  suspend


    amixer -q -D pulse sset Master toggle
philipballew
  • 2,439
  • sleep.d scripts must have quite strict names and structure.... See if http://askubuntu.com/a/436389/16395 helps for hints – Rmano Oct 25 '15 at 08:03
  • So then would this be what you are talking about then? http://paste.ubuntu.com/12941216/ – philipballew Oct 25 '15 at 08:30

1 Answers1

1

Here's how the script in /etc/pm/sleep.d should look like. Name it 20_mute_audio

#! /bin/sh
case $1 in
     suspend|suspend_hybrid|hibernate)
         amixer -q -D pulse sset Master toggle
        ;;
esac
Sergiy Kolodyazhnyy
  • 105,154
  • 20
  • 279
  • 497