We have to keep clicking to increase or decrease the volume on the keyboard volume button.

Can we change the sound volume in a continuous way just by holding down the keyboard volume button and the volume increase/decrease would be proportional to the amount of time i held it down?

(Ubuntu 16.04)


1 Answer 1


You can set up custom keyboard shortcut to do this:

  1. Go to Settings > Keyboard > Shortcuts > Custom Short Shortcuts

Here add new shortcut.Give a name to it and for volume up give the command as:

pactl set-sink-volume 0 +2%

For volume down ;

pactl set-sink-volume 0 -- -2%

Now set the required keyboard short cut by clicking the entry and then pressing the required shortcut.

Once done, close it and test. This solution should work since the we keep the n% change small and by continuous pressing for longer time the n% adds up to give bigger change.

You can also set fixed volume shortcuts like 25%, 50% , 75% and so on. Just use,

pactl set-sink-volume 0 n%

and change n to the required number.

  • 1
    I think you misunderstood my question. I already have the button on my keyboard to increase/decrease volume. I want to hold it down and it changes the volume proportionally to the amount of time I held it down Jun 18, 2016 at 7:15
  • oh, I misunderstood.
    – ankit7540
    Jun 18, 2016 at 7:16

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.