Volume Hot Key not working in Lubuntu

15,330

Solution 1

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>

Solution 2

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>

Solution 3

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.

Share:
15,330

Related videos on Youtube

Admin
Author by

Admin

Updated on September 18, 2022

Comments

  • Admin
    Admin over 1 year

    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.

  • Michael
    Michael almost 6 years
    I think openbox --reconfigure is needed for changes to take effect, but it's still not working for me. I normally have to hit Fn in conjunction with F1, F2, and F3 for volume control (not working) and F5 and F6 for brightness control (which does work).
  • Michael
    Michael almost 6 years
    Ok I take that back, it's actually working, but there is no indicator like the large overlay that shows up when I adjust brightness.
  • meetnick
    meetnick almost 6 years
    @Michael, you are right! This DE doesn't show any OSD overlay for sound. As I never used one, I don't know any one. But you can try google it or even trying to use xfce's one
  • Mahdi-Malv
    Mahdi-Malv about 5 years
    @Michael, Have you found a solution for indicating volume control? I'm having the same issue.
  • Michael
    Michael about 5 years
    @Mahdi-Malv not yet
  • meetnick
    meetnick about 5 years
    @Mahdi-Malv try xfce4-volumed
  • Mahdi-Malv
    Mahdi-Malv about 5 years
    @spucktek Will it work on LXDE?
  • meetnick
    meetnick about 5 years
    @Mahdi-Malv yes!