Gnome Multimedia Keys 2
Amarok 2.x Scripts
Score 54%
Description:

This script will allow the use of keyboard multimedia keys to control playback when running Amarok under Gnome 2.22 and above. The keyboard shortcuts you define system wide will then also work in Amarok 2 as if they were "Global shortcuts". This includes most media buttons found on laptops and keyboards.

Based on my version for Amarok 1.4 http://www.kde-apps.org/content/show.php?content=60910 this is a bit of a hack so please let me know how it works out for you...

Currently supported operations are:
Play/Pause
Pause
Stop
Next Track
Previous Track

Simply run the script, no configuration of the script itself is required. The desired keyboard shortcuts can be configured by selecting "System-->Prefrences-->Keyboard Shortcuts" from the Gnome pannel.

Requires:
python >2.4
python-dbus
libdbus-glib
Last changelog:

8 years ago

2.0: Initial version

polyopath

5 years ago

Due to python2.7 is not linked to python but to python2:

To fix this issue:
modify main.js at line 18, replace "python" for "python2"

Report

polyopath

5 years ago

Due to python2.7 is not linked to python but to python2:

To fix this issue:
modify main.js at line 18, replace "python" for "python2"

Report

BenjaminOechslein

5 years ago

Due to some changes in gnome-settings-daemon this script fails to work in Ubuntu 11.10. The following patch should fix this issue:

Quote:
diff -u a/listner.py b/listner.py
--- a/listner.py 2009-04-25 17:12:41.000000000 +0200
+++ b/listner.py 2011-11-10 17:47:04.000000000 +0100
@@ -84,7 +84,8 @@
raise
try:
listner = bus.get_object('org.gnome.SettingsDaemon', '/org/gnome/SettingsDaemon/MediaKeys')
- listner.connect_to_signal("MediaPlayerKeyPressed", signal_handler, dbus_interface='org.gnome.SettingsDaemon.MediaKeys')
+ listner.GrabMediaPlayerKeys("amarok", 0, dbus_interface='org.gnome.SettingsDaemon.MediaKeys')
+ listner.connect_to_signal("MediaPlayerKeyPressed", signal_handler)
except:
exit(104)
raise

Report

BobEl

4 years ago

I'm not sure what to do with this. I downloaded the archive with 3 files in it. I made listner.py executable (don't know if that was necessary) using: python listner.py. Nothing happened. I hit Ctrl-c to get out. I copied the patch to patch.py and ran it. I got this error:
File "patch.py", line 4
diff -u a/listner.py b/listner.py
^
SyntaxError: invalid syntax
(the formatting changed - the caret was under the a in a/listner)

So I don't know what to do now.

Report

amksep

8 years ago

Thank you for this useful script..
worked perfectly Gnome 2.26.1 amarok 2.1.1

Report

jordz

8 years ago

Thanks it's working fine with 2.0.96 :)

Report

soker

8 years ago

I ran the script and it detects the media keys but seems that there is a problem communicating with amarok process I'm getting this

11846 is us, dont kill!
detected GNOME v2.24
Using new dbus location
next track
DCOPClient::attachInternal. Attach failed Could not open network socket
DCOPClient::attachInternal. Attach failed Could not open network socket
ERROR: Couldn't attach to DCOP server!


do you know what can I do?

Report

C

browner

8 years ago

Sounds like the DCOP server isn't running or isn't properly configured for some reason.

I would try the solutions listed here: http://www.microdevsys.com/WordPress/2008/12/04/fedora-9-kde-4x-error-couldnt-attach-to-dcop-server/

Namely: see if dcopserver is running (ps axfo pid,ppid,user,cmd=|grep dcop)

If not remove stale files like these:

~/.DCOPserver_lhs.localhostservers__0
~/.DCOPserver_lhs.localhostservers_:0
/tmp/.ICE-unix/dcop10328-1227569420
~/.ICEauthority

Restart your Xwindows session and possibly run kdeinit to restart your kde session.

See the link for more details.

Report

C

browner

8 years ago

Oh by the way, I presume you mean my Gnome media keys script for Amarok 1.4 not this one for Amarok 2...? The Amarok 2 script doesnt use DCOP.

Report

soker

8 years ago

yeah!!! this is the moment in which I feel really stupid for testing something made for amarok 1.4 on amarok 2.x. XD
I didn't see that the 2.x number is for gnome version ajajaja

Sorry about that

Report

C

browner

8 years ago

Ye, I guess I should have called it something completely different ;) No worries, glad it works now.

Report

Mozork

8 years ago

I've been looking for this, thanks for the good work.

Report

ciso

8 years ago

works good for me ;)

Report

meerkat

8 years ago

i was really missing this on amarok 2. everything working so far.

Report

8 years ago

2.0: Initial version

product-maker Razor13 Mar 24 2011

File (click to download) Version Description Filetype Packagetype License Downloads Date Filesize OCS-Install DL
Details
version
2.0
updated Apr 25 2009
added Apr 25 2009
downloads today
0
page views today 4