Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I have a keyboard with no specially designed keys, so I was thinking I'd put in windows+up/down for controlling the master volume.

How would I do this?

share|improve this question
    
I actually found this really easysolution. techhamlet.com/2011/12/custom-keyboard-shortcuts-in-linux –  user1068446 Nov 15 '12 at 5:31
    
You didn't specify a linux up front, some have that built in. If you decide you need a more advanced distro at some point, xbindkeys has a gui too. I just don't use those much. Glad you're squared away. –  nerdwaller Nov 15 '12 at 7:41
add comment

1 Answer 1

up vote 2 down vote accepted

An easy way is installing xbindkeys.

To set it up, once installed you need to set the ~/.xbindkeysrc file to tell it your commands. (You can copy over their defaults, but in my opinion they are awful - one example being Ctrl+F does not FIND anymore. If you want the defaults, just type xbindkeys and it will instruct you how to get them).

So instead, I would suggest you make your own with vim or gedit or whatever you prefer with the layout of:

vim ~/.xbindkeysrc

"command to run"
(tab) keycommand

(the tab is a real tab, not the word+perens "(tab)")

To get the key code, run (in the terminal) $ xbindkeys -k, that will pop up a dialog to tell you it's ready, hit your key codes and it will spit out the "command to run" (if it is bound to anyting) and then the keys (like Super_L+). That will be all the info needed for you to set up .xbindkeysrc.

For example, here is how mine looks (picture the non quoted lines as tabbed in):

"amixer set Master 5%+"
XF86AudioRaiseVolume
"amixer set Master 5%-"
XF86AudioLowerVolume
"amixer set Master toggle"
XF86AudioMute
"gnome-screensaver-command -l"
XF86ScreenSaver
"banshee --next"
XF86AudioNext
"banshee --restart-or-prev"
XF86AudioPrev
"banshee --toggle-playing"
XF86AudioPlay
"action"
XF86Launch1

Last thing you need to do is set xbindkeys to run at login. For Gnome/Mate/Cinnamon hit Alt+F2 and then type gnome-session-properties, click Add+ and for the command it's xbindkeys. The other two items are up to whatever you want.

share|improve this answer
    
I do like your answer. It's good an informative. –  user1068446 Nov 15 '12 at 8:20
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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