Volume up and down with keyboard in Xfce with amixer

Usually when we use a laptop, this type of equipment has keys with multimedia functions to control the volume of output through the speakers, but a conventional PC, with a conventional keyboard, this is not the case.

In my case, with Xfce I have found a way to upload, get off, silence y activar the volume using amixer, which is nothing more than a mixer for Alsa which is used through command lines. The commands I used in this case, along with the key combination, I put below:

Turn up the volume:
command: amixer sset Master playback 5%+ with the keys: [Ctrl] + [+]

Volume Down
command: amixer sset Master playback 5%- with the keys: [Ctrl] + [-]

Put everything on Silent:
command: amixer sset Master mute with the keys: [Ctrl] + [*]

Activate the sound:
command: amixer sset Master unmute with the keys: [Ctrl] + [/]

I must clarify that Master is the channel to which I am going to apply the options. As usual in Xfce, to configure these shortcuts we go to Menu »Preferences» Keyboard »Application shortcuts and it should stay as in the image.

Sure, you can use the shortcuts you prefer 😀

The content of the article adheres to our principles of editorial ethics. To report an error click here!.

21 comments, leave yours

Leave a Comment

Your email address will not be published. Required fields are marked with *



  1. Responsible for the data: Miguel Ángel Gatón
  2. Purpose of the data: Control SPAM, comment management.
  3. Legitimation: Your consent
  4. Communication of the data: The data will not be communicated to third parties except by legal obligation.
  5. Data storage: Database hosted by Occentus Networks (EU)
  6. Rights: At any time you can limit, recover and delete your information.

  1.   nonamed said

    Well, on my keyboard the volume keys work perfectly, in xfce, without configuring anything

    1.    elav <° Linux said

      What are the keys you use?

      1.    nonamed said

        a special key that puts FN on the keyboard and at the same time:

        cursor right (volume up)

        cursor left (volume down)

        cursor down (mute)

        volume figures appear on the cursors on the keyboard to differentiate them

        It is a multimedia keyboard that came with the mouse, wireless, logitech

        1.    elav <° Linux said

          Man, but that's a laptop or netbook right? I am talking about a normal PC with a keyboard without the FN key.

          1.    Courage said

            They also have FN, at least here, no idea in your land

          2.    nonamed said

            Yes, on a PC, with your monitor, multifunction printer, multimedia speakers, and various other comics xD

            there are multimedia keyboards for all tastes

  2.   hypersayan_x said

    Ehmm…, it is not a very good idea to use [Ctrl] + [+] and [Ctrl] + [-] to change the volume, that combination is used by many programs, for example Firefox and Chrome to change the zoom of the pages.
    In any case, [Super] + [+] and [Super] + [-] would be more convenient.

    1.    elav <° Linux said

      Yup, you're right. U_U

  3.   Santiago said

    My keyboard does not have the multimedia keys, so it is excellent for me to continue improving my XFCE.

    Thank you!!

  4.   Alex said

    There is another alternative that consists of using xfce4-volumed

    1.    ihesner said

      With xfce4-volumed it worked perfect for me. thanks…

  5.   Mauritius said

    I used the same commands, but associating the multimedia keys because xfce did not recognize the Fn keys, but then I discovered the Fnfx package and did not have to use them anymore.

  6.   alter said

    My laptop has the Fn keys and even so I had to configure as you say xD. What does not appear is the OSD, how did you put it?

  7.   Augustine said

    Thank you, it helped me 😀

    1.    KZKG ^ Gaara said

      A pleasure for us 😀

  8.   Mario Mey said

    I have been using this technique for a year… using Ctrl-Fn-F9… because Fn-F9, which was the original, doesn't work. When I assign it, it tells me if I want to replace the original which supposedly controls volume with PulseAudio. But no matter how much you replace it, it doesn't work.

    Do you know something about this?

    Thank you.

  9.   danielga said

    Because it may not show me in the notify the volume when it goes up or down. The rest works

    Thank you

  10.   jair said

    It was very helpful, since my keyboard has no volume control 🙂 Xubuntu 14.4

  11.   JOSEPH said

    I want to continue creating more keyboard shortcuts in the same way, for example the shutdown button, what would be the command to shut down the computer?

  12.   Manual said

    Excellent post, it has been very useful to me.
    thank you very much.

  13.   dextre said

    MANY Thanks for your help. I don't know what happened with the volume keys, they stopped working on my Xubuntu 17.04.1 but thanks to the tutorial it's fine again.
    sañudos from Lima Peru