
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.
8 years ago
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
8 years ago
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
bal0r
5 years ago
In order to make it working I needed to change the shebang line to:
#!/usr/bin/env python2
Kind regards,
Max
Report
Jojo12a
8 years ago
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.
Report
rubyinthedust
8 years ago
Report
Jojo12a
8 years ago
Report
stimpyjcat
8 years ago
Will be possible to get the same behavior as the (ugly) OSD with this script when using streams?
Report
Daniel2009
8 years ago
Report
apolodor
8 years ago
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).
Report
apolodor
8 years ago
- OS: Kubuntu Jaunty
- KDE 4.3 RC2
- Amarok 2.1.1
Report
meerkat
8 years ago
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?
Report
apolodor
8 years ago
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.
Report
meerkat
8 years ago
http://mantis.blogsport.de/images/NotifyAmarok1.1.amarokscript.tar.gz
Report
apolodor
8 years ago
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.
Report
meerkat
8 years ago
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.
Report
apolodor
8 years ago
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).
Report
meerkat
8 years ago
Report
alexbuzeta
8 years ago
You could fix it, please?
Report
meerkat
8 years ago
Report
meerkat
8 years ago
Report
alexbuzeta
8 years ago
I installed the final version of Amarok 2.1 and NotifyAmarok 1.0 and works great
Thanks for the help!
Report
zeratul2099
8 years ago
Thanks for the app :)
Report
finifly
8 years ago
Report
meerkat
8 years ago
Report
finifly
8 years ago
Report
finifly
8 years ago
Report
meerkat
8 years ago
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.
Report