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.
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.
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.
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?
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.
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
Ratings & Comments
13 Comments
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"
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"
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
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.
Thank you for this useful script.. worked perfectly Gnome 2.26.1 amarok 2.1.1
Thanks it's working fine with 2.0.96 :)
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?
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.
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.
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
Ye, I guess I should have called it something completely different ;) No worries, glad it works now.
works good for me ;)
i was really missing this on amarok 2. everything working so far.