Gnome Multimedia Keys 2

Amarok 2.x Scripts

Source i (link to git-repo or to original if based on someone elses unmodified work):

Add the source-code for this project on opencode.net

0
Become a Fan
5.7

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:

2.0: Initial version


Ratings & Comments

13 Comments

polyopath

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"

polyopath

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"

BenjaminOechslein

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

BobEl

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.

amksep

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

jordz

Thanks it's working fine with 2.0.96 :)

soker

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?

browner

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.

browner

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.

soker

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

browner

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

ciso

works good for me ;)

meerkat

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

Pling
0 Affiliates
Details
license
version 2.0
updated
added
downloads 24h 0
mediaviews 24h 0
pageviews 24h 1

Other Amarok 2.x Scripts:

raya
raya1234
last update date: 15 years ago

Score 5.0

Partition Assistant
shiny521
last update date: 15 years ago

Score 5.0

google-clone
jenifferhomes
last update date: 15 years ago

Score 5.6

Quran Audio Library
boubakr92
last update date: 12 years ago

Score 4.4

Remove Current Track
alexoleshkevich
last update date: 14 years ago

Score 4.7

indoLyrics
cyrus007
last update date: 14 years ago

Score 4.7



System Tags