After writing about how tocreate a shortcut or hotkey to mute the speakers in Windows, I got a couple of requests for how to do the same thing in Linux, which turns out to be really simple if you are running the latest version of Ubuntu or Gnome.
If your version doesn’t have the easy option you’re able to still do the same thing in many versions of Linux with a simple command line.Setting the Hotkey on UbuntuSimply go to System \ Preferences \ Keyboard Shortcuts and then assign a hotkey to the Sound \ Volume mute item.
Once you use the hotkey you’ll see a little dialog pop up to show you what the current volume state is (it’s possible for you to quickly hit the hotkey again to toggle back and forth)
Using the Command Line / ScriptsAlternatively, it’s possible for you to assign a shortcut key to a script that uses the amixer utility to toggle the mute state.
To test this out, just open up a terminal window and then use this command:
amixer sset Master toggle
You’ll see the output right there in the console, telling you whether it’s now set to off or on:
And your volume icon should show that the volume has now been muted.
you’re free to create a shortcut to run this command by right-clicking anywhere and using Create Launcher, adding in the full command from above into the Command box.