How to create hotkeys for audio up down etc.

Questions about codecs, DVD playback, web plugins...
Forum rules
Before you post please read how to get help
Post Reply
raritz121
Level 1
Level 1
Posts: 6
Joined: Thu Mar 30, 2017 4:04 pm

How to create hotkeys for audio up down etc.

Post by raritz121 »

How ie. what is command or other program needed with "syntax examples" to create keyboard hotkeys to increase or decrease volume??

Please... syntax examples. Linux is VERY WEAK on syntax EXAMPLES!!

Is xbindkeys with xinput some possibility? Again... cant figure out syntax.

Kindly request PM

Thanks much... raritz121

rene
Level 16
Level 16
Posts: 6554
Joined: Sun Mar 27, 2016 6:58 pm

Re: How to create hotkeys for audio up down etc.

Post by rene »

raritz121 wrote:Linux is VERY WEAK on syntax EXAMPLES!!
"Linux" is not one thing; it's many distributions, using different setups and environments, and its a lot of information on the internet not at all applicable to your specific setup and environment. It takes a while to recognize that. Are you posting this question in the context of the Cinnamon desktop? If so: Settings -> Keyboard -> Shortcuts.

If your keyboard has dedicated volume up/down buttons, they should in fact work out of the box: the X86Audio{Raise,Lower}Volume entries you see there. In any case, no "syntax" required; xinput is at a lower level than you likely need or are looking for.

No PM. The point of fora is that an answer can help more than one person at a time.

raritz121
Level 1
Level 1
Posts: 6
Joined: Thu Mar 30, 2017 4:04 pm

Re: How to create hotkeys for audio up down etc.

Post by raritz121 »

I am using tower computer all intel with Linux Mint xfce serena 18.1 I am no programmer so exact syntax is vital so any help on syntax like a manual for all built in commands would be soooo great. Man is minimal help re syntax. For ex. I have done xinput --help and last point is <device> which again is syntax problem for me. What should I put for <device>??

I can do this volume control in Windows XP/7 using Autohotkey which is GREAT and I MISS it SOO much. Maybe there is a similar program or command in Mint 18.1 xfce serena and I have tried Autokey but is very minimal not even close to AutoHotKey in Win system.

So... since i have tower/desktop computer I want to find some commands (w syntax) to assign to the keyboard.

Thanks much in advance!!!!

ajgreeny
Level 5
Level 5
Posts: 581
Joined: Mon Nov 19, 2007 3:27 pm

Re: How to create hotkeys for audio up down etc.

Post by ajgreeny »

I am not sure how you create new keyboard shortcuts in Mint as I am using Xubuntu 16.04 but I think these three commands may work in any DE so you can try using them with your keyboard shortcut creation utility.

Code: Select all

amixer set Master playback 3dB-
command to reduce volume by 3dB

Code: Select all

amixer set Master playback 3dB+
command to increase volume by 3dB
and just in case you need it

Code: Select all

amixer -D pulse set Master toggle
command to toggle mute/unmute volume.

I hope these work in Mint as they do in *ubuntu OSs and that you find them useful.

rene
Level 16
Level 16
Posts: 6554
Joined: Sun Mar 27, 2016 6:58 pm

Re: How to create hotkeys for audio up down etc.

Post by rene »

It's somewhat better to use pactl directly rather than route through amixer if pulseaudio is in fact the level you wish to control (as is the case here). That is, go into Settings -> Keyboard -> Application Shortcuts and choose Add. As command use

Code: Select all

pactl set-sink-volume @DEFAULT_SINK@ +5%
press OK and then whichever key(-combination) you wish to assign to volume-up; vary the "5" as per taste of course and/or try man pactl for other specification methods. Repeat with

Code: Select all

pactl set-sink-volume @DEFAULT_SINK@ -5%
and the desired volume-down key, and with

Code: Select all

pactl set-sink-mute @DEFAULT_SINK@ toggle
and the desired mute-toggle key.

You will also get OSD for the keys the same as for standard multimedia keys. It's by the way also in Xfce the case that any such present standard multimedia keys should in fact work out of the box so it is assumed in the above that you don't use a multimedia keyboard. If you do, you want to go find out why the multimedia keys are not being recognized instead.

raritz121
Level 1
Level 1
Posts: 6
Joined: Thu Mar 30, 2017 4:04 pm

Re: How to create hotkeys for audio up down etc.

Post by raritz121 »

Thanks very much!!

pactl set-sink-mute @DEFAULT_SINK@ toggle worked perfect!!!!

Post Reply

Return to “Sound, Multimedia, & Codecs”