Comment 67 for bug 126333

Revision history for this message
Sardar (ja-doma) wrote :

Solution seems to work best: https://bugs.launchpad.net/gnome-applets/+bug/126333/comments/42

The following is for metacity & ALSA users:

We need to determine correct media keys, so;
System -> Preferences -> Keyboard Shortcuts
Change shortcuts for Volume Up/Down/Mute by click in the field and then pressing the key combination (media key). Value should change from "Disabled" to something like "XF86AudioRaiseVolume" etc.

Application -> System tools -> Configuration Editor
(if not found: Alt-F2 or open terminal and type "gconf-editor")
navigate to: /apps/gnome_settings_daemon/keybindings
Change keys "volume_down|up|mute" to empty value, but before that copy the contents (correct name of your media key).

Open: /apps/metacity/global_keybindings, find empty run_command_N keys (have value "disabled"), put media-key names from the previous step. Now metacity will fire up these commands/events whey you press your media key.

Open: /apps/metacity/keybinding_commands, locate command_N entries for which you have set the key combinations in previous step. Put:

volume up: "amixer -c 0 set Master 2dB+"
volume down: "amixer -c 0 set Master 2dB-"
toggle mute: "amixer -c 0 set Master toggle"

amixer works directly with ALSA, so try these commands in command line before doing this all. You may find another way to change your sound settings, then just put that command as described above.

Compiz users: install CompizConfig manager, General Options -> General -> Key bindings
Provide key bindings and commands as described above. On my machine compiz automatically uses metacity keybindings.