Volume Hot Key not working in Lubuntu

I installed Lubuntu(14.04.2 LTS) in my Lenovo Z510.

The multimedia hot keys in my laptop is independent. Means to use multimedia keys I don't have to press Fn key. The brightness hot keys are working perfectly but only the volume buttons(mute, volume up, volume down) not working.

I tried

gsettings reset org.gnome.settings-daemon.plugins.media-keys volume-up
gsettings reset org.gnome.settings-daemon.plugins.media-keys volume-down
gsettings reset org.gnome.settings-daemon.plugins.media-keys volume-mute

but still nothing happens.


on 17.04, default volume commands won't work, because on ~/.config/openbox/lubuntu-rc.xml the amixer command is wrong. In order to fix it, find "XF86Audio" key tags

<keybind key="XF86AudioRaiseVolume">
      <action name="Execute">
        <command>amixer -q sset Master 3%+ unmute</command>
      </action>
    </keybind>
    <keybind key="XF86AudioLowerVolume">
      <action name="Execute">
        <command>amixer -q sset Master 3%- unmute</command>
      </action>
    </keybind>
    <keybind key="XF86AudioMute">
      <action name="Execute">
        <command>amixer -q sset Master toggle</command>
      </action>
    </keybind>

change amixer -q option to "amixer -D pulse". the file must be like the following:

<!-- Keybinding for Volume management -->
    <keybind key="XF86AudioRaiseVolume">
      <action name="Execute">
        <command>amixer -D pulse sset Master 3%+ unmute</command>
      </action>
    </keybind>
    <keybind key="XF86AudioLowerVolume">
      <action name="Execute">
        <command>amixer -D pulse sset Master 3%- unmute</command>
      </action>
    </keybind>
    <keybind key="XF86AudioMute">
      <action name="Execute">
        <command>amixer -D pulse sset Master toggle</command>
      </action>
    </keybind>

Try to change some commands in $HOME/.config/openbox/lubuntu-rc.xml

<!-- Keybinding for Volume management -->
<keybind key="XF86AudioRaiseVolume">
<action name="Execute">
<command>amixer -D pulse sset Master 3%+</command>
</action>
</keybind>
<keybind key="XF86AudioLowerVolume">
<action name="Execute">
<command>amixer -D pulse sset Master 3%-</command>
</action>
</keybind>
<keybind key="XF86AudioMute">
<action name="Execute">
<command>amixer -D pulse sset Master 0%</command>
</action>
</keybind>

In Lubuntu 18.04.1 my speaker volume control hot keys did not work. In trying to find a way to edit the lubuntu-rc.xml file I found a GUI approach to achieving the same results as answered by @spucktek and @Alexander Mordovskiy. The solution is still to change the XF86Audio command lines from "-q sset" to "-D pulse sset".

To modify the lubuntu-rc.xml file in the GUI -> select "Menu" from the desktop panel, my menu button is on the bottom, -> then "Preferences" -> "Set Up Hot Keys".
The LXHotkey panel opens up. There are two tabs at the top of the panel, Actions and Programs. -> Select the Programs tab.

Find the "XF86AudioRaiseVolume" asset under the Hotkey 1 column.
-> doubleclick 'XF86AudioRaiseVolume' and a small edit panel opens. -> in command line field change the "amixer -q sset Master 3%+ unmute" line from 'amixer -q sset' to "amixer -D pulse sset"

The command line should now read "amixer -D pulse sset Master 3%+ unmute" -> click the [check button] at the top of the panel to apply the changes.

Repeat for entries "XF86AudioLowerVolume" and "XF86AudioMute". Once you're finished -> save your changes by clicking the "folder" icon button located directly below the "Edit" menu.

Hopefully a noob like myself will find this helpful.