9

I'm trying to set my numpad to be a media control centre. I want to have the 0 key pull up Clementine and bring it to the foreground. Right now I have it set to launch Clementine, but it just dances in the launcher and doesn't come to the foreground. So, I have Clementine pinned to the second slot on the launcher, and I want to set up a custom key shortcut via the Keyboard Settings. The question is, how do I send Super+2 as a command?

Second, I want the plus and minus keys to send Alt+Left and Alt+Right (for browser navigation).

Third, and less important, I want the period key to open Clementine's EQ, and 7 and 9 to send Fast Forward and Rewind.

3 Answers 3

7

How do I send Super+2 as a command

You could use xdotool for this (sudo apt-get install xdotool to install):

xdotool key super+2

Second, I want the plus and minus keys to send Alt+Left and Alt+Right

This should work:

xdotool key alt+Right
xdotool key alt+Left

7 and 9 to send Fast Forward and Rewind

You could give these a try:

xdotool key XF86AudioNext
xdotool key XF86AudioPrev

I want the period key to open Clementine's EQ

This is where things get tricky. Without a dedicated shortcut you would have to program an xdotool macro to access the menu and launch the equalizer, but I am not quite sure if that would work, either.


In any case, as you can see most of these customizations can be performed using virtual xdotool key presses.

If you are wondering how to assign these commands to hotkeys of your choice make sure to check out this Q&A:

How can I change what keys on my keyboard do? (How can I create custom keyboard commands/shortcuts?)

1
  • Thanks! This is exactly what I needed. The Super+2 command works great, although some of the time it behaves like just Super. Hmm... In any case, it's something. The browser nav commands work perfectly. I found out Clementine actually has command line controls for nearly everything, so for fast forward and rewind, I use clementine --seek-by 2 and clementine --seek-by -2. Still working on the EQ part of it.
    – wjandrea
    Nov 16, 2014 at 1:58
3

Another (I think easier) approach would be to use AutoKey.

Once the keys are set as hotkeys, you can use custom defined phrases to have them emit almost anything you want.


AutoKey also supports scriptis written in Python that can do almost anything when they are activated by a trigger phrase or hotkey. You can even tell a script to only work in certain windows so the hotkeys/trigger phrases behave as normal keys elsewhere.

1

Probably you can grab the scancodes of the keys and assign the shortcuts manually. The article below lists some utilities that might help: http://tuxdiary.com/2014/03/07/get-scancode-for-keys-on-ubuntu/

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .