howto associate dell multimedia keys with amarok in gnome??

Asked by hormosapiens

hi
here is my problem.. how to associate the dell multimedia keys(not those on the keybord) with amarok under ubuntu 7.04 that comes with gnome. I mean, (play/pause, rewind,forward, stop) keys that are located in the front of any dell inspiron 6400/1505. for what I understood, the problem is that gnome default music player is rythmbox, and I installed amarok whic is seriously super like uncle rodney says,,,,so when I press one of those keys it says: "couldn't execute command rythmbox.verify that this command exist", cause I uninstalled rythmbox. I've tried with keyboard shortcuts in main/menu/system/preferences but it's impossible to assign the function with those keys to amarok.
I had kde under kubuntu feisty some times ago and those keys worked out af the box with marok. I wold like to have the same functions/keys/amarok under gnome.
specs:dell inspiron 6400 duo2core 2ghz, ati x1300, 1gb ram, ubuntu7.04, gnome 2.18, xserver 7.2, kernel 2.6.20. the information for amarok says that im using: amarok 1.4.5 (using kde 3.5.6).
please help:)
thank u very much.
adi

Question information

Language:
English Edit question
Status:
Solved
For:
Ubuntu Edit question
Assignee:
No assignee Edit question
Solved by:
Markus Thielmann
Solved:
Last query:
Last reply:
Revision history for this message
Best Markus Thielmann (thielmann) said :
#1

Thanks for your question.

Please try do delete the Multimedia Shortcuts in System/Preferences/Keyboard Shortcuts. After that, try to enable shortcuts within amarok (Settings->Shortcuts).

If that doesn't work, you might try keytouch (http://keytouch.sourceforge.net, "sudo apt-get install keytouch keytouch-editor). This is what I'm using to get my multimedia keys to work properly.

Revision history for this message
hormosapiens (hormosapiens) said :
#2

thanks a lot. now it is how I wanted to be. keytouch was not necessary. the first howto worked well.
thank you markus..:)

Revision history for this message
BrowneR (chris-scotland) said :
#3

Hi,

The problem with deleting the shortcuts in "System/Preferences/Keyboard Shortcuts" is that you then loose their functionality in gnome applications such as rhythmbox or totem.

Although this may work as a solution I believe I have a better one which allows the shortcuts to remain active in all gnome applications you may use and also work in amarok or kaffeine.

Just download my little amarok script from my website (http://chris.scotland.googlepages.com/) or directly from the amarok script manager. its called "gnome media keys".

Hope someone finds this useful.

Cheers

Revision history for this message
green2000 (greenspam2000-ml) said :
#4

awesome!
this made the media keys work for the keyspan PRUS2 remote
http://www.keyspan.com/products/prus2/
it now works with ubuntu 8.04 and amarok
cheers

Revision history for this message
green2000 (greenspam2000-ml) said :
#5

I meant BrowneR 's script for running amarok:
http://chris.scotland.googlepages.com/

Revision history for this message
Daak Teleute (daakadence) said :
#6

I had trouble as this script hangs..

24759 is us, dont kill!
detected GNOME v2.24
Using new dbus location

hangs at this point.
no error. any ideas?

Revision history for this message
Uri Shabtay (uri.shabtay) said :
#7

it doesn't hang
it simply make the commands work. start Amarok, run the script, and press the multimedia keys.. you'll see it works just fine..

Revision history for this message
Patrice Dubé (patricedube) said :
#8

it work, yes and no, it only work when amarok is active on the desktop, if you minimize it or put it in the system tray, the keys doesn't work !

so any trick to make it work all around ?

Revision history for this message
BrowneR (chris-scotland) said :
#9

That's very odd. It should work regardless of whether Amarok is minimised or not as the script runs all the time in the background and is not part of the main Amarok process.

I have no problems like this.

Can I suggest you remove any keybindings you have set in amarok's global shortcuts menu and then make sure the correct shortcuts are selected in the gnome "System-->Prefrences-->Keyboard Shortcuts" menu. Then maybe remove and reinstall the script and restart Amarok.

Figners crossed that will fix it for you.

Revision history for this message
Patrice Dubé (patricedube) said :
#10

the fingers crossed didn't work !!

any suggestions ?

i did everythings, still not working.

Revision history for this message
BrowneR (chris-scotland) said :
#11

It's very strange that it only works when Amarok is maximised.

Sorry Patrice I can't think what might be the problem. :(

You could try opening Amarok and then also opening a terminal window and running the script separately to see if there are any errors.

1) Open amarok
2) Open terminal and type:
3) python ~/.kde/share/apps/amarok/scripts/gnome_media_keys/gnome_media_keys.py

Let me know if you get any errors and then try minimising Amarok and testing the buttons. Good luck!

Revision history for this message
Patrice Dubé (patricedube) said :
#12

hi

now after removing the global shorcut , make sure that the correct shortcuts are selected in the gnome "System-->Prefrences-->Keyboard Shortcuts" menu, start the script (in console no error seem there)
nothing work now !! not even when maximize :(

Revision history for this message
Patrice Dubé (patricedube) said :
#13

i did more test when i send the "dcop amarok player stop or next or playpause " in console that work, even with amarok minimize, it seem to miss the connection in between the key and the action....

Revision history for this message
Patrice Dubé (patricedube) said :
#14

finaly i made it work, without the script, and by disable the gnome keyboard shortcut, and set up the global shortcut in amarok and do xmodmap -pke | grep XF86Audio in terminal and find out that i had a couple of doublon !!! so i clear the file and now everything work everywhere !!! thx for all

Revision history for this message
BrowneR (chris-scotland) said :
#15

ok, glad you got it working.

Revision history for this message
jirihuf (jirihuf) said :
#16

What file did you delete, Patrice?

Revision history for this message
Patrice Dubé (patricedube) said :
#17

it'S not a file , it's inside a file do in terminal

xmodmap -pke | grep XF86Audio

and see if you have things in double
you should have somethings like that !!

keycode 121 = XF86AudioMute NoSymbol XF86AudioMute NoSymbol XF86AudioMute
keycode 122 = XF86AudioLowerVolume NoSymbol XF86AudioLowerVolume NoSymbol XF86AudioLowerVolume
keycode 123 = XF86AudioRaiseVolume NoSymbol XF86AudioRaiseVolume NoSymbol XF86AudioRaiseVolume
keycode 171 = XF86AudioNext
keycode 172 = XF86AudioPlay
keycode 173 = XF86AudioPrev
keycode 174 = XF86AudioStop

make sure that in System-->Prefrences-->Keyboard Shortcuts those specific key are disable after go in amarok setting -->configure shortcut and assign the action whith the media key in the global section.

should work !!

Revision history for this message
jirihuf (jirihuf) said :
#18

Thank you for the response!