NotifyAmarok (Gnome)

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

4
Become a Fan
4.7

Description:
Alternative OSD through Gnome Notification Daemon

This script shows information about the currently played track as a notification using a notification daemon that implements the freedesktop.org dbus interface (e.g. libnotify or notify-osd). It is intended to replace Amaroks own OSD, so its recommend to deactivate this via the configuration menu.

Dependings:
* Amarok 2.x
* notify-osd (recommend) or libnotify-bin
* imagemagick
(if you use libnotify)

Some example strings for the configuration are available on my blog: http://mantis.blogsport.de/2009/07/08/notifyamarok-configuration/

UPDATE (1.11.09):
ubuntu karmic (9.10):

Due to some changes in notify-osd for karmic some issue evolved concerning amarok notifications:
1. The update seems to have become slower which first of all sometimes causes empty notifications.
2. Newlines in the title are prevented by design now.
3. The destruction of notifications stopped working so there is an additional standard duration without update after the duration time thats set in the NotifyAmarok configuration.
As I unfortunately dont have time for this project at the moment I most likely wont fix this in the near future. Sorry!

KDE 4.3:
KDE 4.3 now support the freedesktop.org specifications, but unfortunately no smooth update. If you are using KDE, i recommend you to use thesalus' amaroknotify (http://www.kde-apps.org/content/show.php/amaroKnotify?content=103197), which provides nearly the same functionality now, but is developed for KDE.
Last changelog:

1.0
Major development step with stunning new features
* Full Configurable Notification Title, Body and Duration with all song information available and nice unicode symbols
* A nice Help Window that (i hope) explains the configuration accurately
* set Keybinding to trigger a notification when ever you wonder which song is playing atm (though not very straightforward yet) see "Questions and Answers" for Details
* finally just using the same cover images Amarok does without searching for fitting covers
* new code concept/structure that benefits future development of more new features
* now works on Amarok 2.1 Beta as well


Ratings & Comments

39 Comments

bal0r

Hi, thanks for this nice script. In order to make it working I needed to change the shebang line to: #!/usr/bin/env python2 Kind regards, Max

Jojo12a

One small bugfix: Icon filenames that contain spaces (or other characters specially treated by bash) will not work in the current implementation because in line 106, resize = subprocess.Popen("convert -resize 50x50 "+icon+" "+path+"/temp.png", shell=True, stdout=subprocess.PIPE,) has to be replaced by resize = subprocess.Popen(("convert", "-resize", "50x50", icon, path+"/temp.png"), stdout=subprocess.PIPE,) shell=True is not a that good idea because you should try to avoid shell escapes. Also, please replace all Template(sys.argv[i]) calls by Template(unicode(sys.argv[i], 'utf-8')) so that Unicode strings are allowed in the template strings.

rubyinthedust

Good work, although this looks really nice this is not KDE material - there are far too many Gnome deps. Alone script requires banshee gnome-mount gajim and pidgin notifiers, which are all Gnome apps, and those require even more libraries. Installation will take me hours, for a script?

Jojo12a

Well, I don't suppose this is for KDE users because it is all about better integration of the KDE application Amarok into GNOME. But it is a script for a KDE application so I suspect it to belong here anyway.

stimpyjcat

Streams like radioparadise.com give the song details (artist and title) and the (ugly) OSD show them when change, but theres no real track change for amarok so the notifyamarok script dont work. Will be possible to get the same behavior as the (ugly) OSD with this script when using streams?

Daniel2009

Same problem here, don't work with Internet radio streams. KDE 4.3.0, Amarok 2.1.1. Must use the ugly OSD for now :-(

apolodor

Thank you for the script, it work nicely even under KDE. Just one thing: it does not seem to work when it needs to show characters with accents (like é). All text is missing (I get a blank popup with only the cover image). If it helps, the ID3 tags for those specific MP3 files might be UTF-8 encoded (with EasyTAG).

apolodor

I forgot to mention my configuration: - OS: Kubuntu Jaunty - KDE 4.3 RC2 - Amarok 2.1.1

meerkat

hm, thats strange - i remember having those problems in an early version, but they were solved when i moved from amarok api to dbus as source of the track information. anyway, cant see how utf-8 can be the problem - actually the script is encoding everything to utf-8. please check if dbus is providing the track information correctly (e.g. by typing the following in your terminal when a track in question is playing in amarok): qdbus org.kde.amarok /Player GetMetadata are you sure it's caused by the accent characters or are there other special characters (e.g. $ or ") in your tags in question? are the notes ♫ and the play symbol ▶ shown in your notifications? does the problem appear in head as well as body of the notification and title as well as artist tag?

apolodor

I have done some tests and I managed to locate the problem. I have tested only combinations of 3 fields: artist, title, and album. My configuration for the script was: Head: $artist$n$notes $title $notes Body: $album ($year)$n$play $elapsed /$total The symbols for "notes" and "play" appear fine, btw. I tried removing various parts from both the head and the body and it seems that the error appears only if both the following conditions are true: - the artist or the album field contains a character with an accent - that specific field is not "alone" in its position (be it Head or Body). So, if $artist is Händel (and no other fields are special): This version Head: $artist Body: $title - $album works fine, while this version Head: $title Body: $artist - $album throws a blank. If only the title has a special character, everything works fine, no matter how the @title field is combined. I hope this helps.

meerkat

thanks for the detailed description. i have no idea why those encoding problems occur and i sadly cant test on them, because on my system everything works fine. nevertheless ill look into it when i find time to. in the meantime you can test this little hack, that may solve your specific problem, but also may cause other: http://mantis.blogsport.de/images/NotifyAmarok1.1.amarokscript.tar.gz

apolodor

I did not try to use version 1.1 until I have updated to KDE 4.3 RC3 and NotifyAmarok stopped working altogether. The interesting thing in KDE 4.3 RC3 is the developers unified the notification system, so even the notifications sent through notify-osd appear through the KDE notification system. Something in this change made NotifyAmarok 1.0 stop working, so I updated to 1.1 from the link you gave me. The good news: - It is working again! - The characters with accents are no longer a problem! The ??? news: - The notifications appear through KNotify. This means (I think) that using the Gnome-style notifications under KDE 4.3 is out of the question. Personally, I do not have a problem with that (I'm interested in the quality of the notifications, not the format, and a unified format appeals to my sense of order), but others might have. - Right now, NotifyAmarok and amaroKnotify looks quite similar under KDE, but your script is still a lot more configurable. The bad news: - The line breaks ($n) are replaced with simple white spaces. - The album cover is not shown - the default KDE "missing" icon is shown instead. Though, if the album has no cover, the default "nocover" image IS shown! A bug, maybe? Also, the image shown is very, very small, because of the placement in the notification format. - Instead of appearing, staying on screen for the set time, and then disappearing, the notification appears for a second, disappears, appears again for a second, disappears again, and the cycle keeps repeating for the set time. I hope this helps. You have done a great job with this script and I long to see it perfected.

meerkat

i have checked on kubuntu karmic alpha and can confirm all your observations. well it seems kde is starting to support the freedesktop notification interface which is good news for the integration of gnome software in kde and vice versa (examples: http://www.kdedevelopers.org/node/4028). there still seems to be some bugs though but im confident theyll be fixed till karmic final in october. the only thing i can do in the meantime is prevent the blinking by deactivating the update if knotify is used and maybe fix the image problem. ill try that sometime next week. thanks for your detailed report on the problems with kde 4.3.

apolodor

I managed to fix the issue of the notification appearing, disappearing, appearing, etc. by changing time.sleep(0.98) into time.sleep(10) in notify.py. Still, I realized that the displaying time of the notification is not the one specified in the settings, but probably the one default for KDE (about 3 seconds).

meerkat

good thinking. i just realized that i havent commented my sourcecode at all - i should add some comment in the next release. you actually changed the update interval from nearly 1 sec to 10 sec which prevents the blinking as long as the duration is < 10 sec. the duration time falls back to default this way, ill handle that together with the other issues in my next release.

alexbuzeta

I use Amarok 2.1 Beta 1 and Ubuntu You could fix it, please?

meerkat

thanks for the hint, i'll investigate why that is the case

meerkat

I tested with Amarok 2.1 Beta 2 on Ubuntu 9.04 and the new version (1.0) works fine there. Dont know why the previous version didnt work, but it used a lot more of the Amarok Script API, maybe something changed there. Please test if the new version works on your system as well.

alexbuzeta

Now it works! I installed the final version of Amarok 2.1 and NotifyAmarok 1.0 and works great Thanks for the help!

zeratul2099

Works great here with Amarok 2.1 and Ubuntu 9.04. Thanks for the app :)

finifly

It's not working with mine. I'm on Jaunty 64 and have Amarok 2.1.1.

meerkat

i checked on jaunty 64bit live cd with amarok 2.1.1 and everything worked fine. did you activate the script in the script manager (check the checkbox)? could you please specify the problem: does it install / show up in the script manager? what exactly is not working? etc.

finifly

Yes I have installed it. I tried from the script download window in amarok and this site. And yes the check box is checked. After restarting amarok, nothing shows up.

finifly

Sorry, I didn't actually realize that this is for Gnome. I use KDE. Sorry about that!

meerkat

the script was originally created for gnome, but it works with kde as well, see here: http://www.kde-apps.org/content/show.php?action=knowledgebase&content=103307&kbid=73 note that the above is only true for kde versions before the new kde 4.3, that just was released a week ago. for kde 4.3 you wont need any additional packages, as knotify now implements the dbus api my script uses. unfortunately there are some serious issues with that (see apoldors posts below), so if you are on kde 4.3 please wait till they are fixed or i released a temporary workaround which i will implement as soon as i find time for that.

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

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