amaroKnotify

Amarok 2.x Scripts

Source (link to git-repo or to original if based on someone elses unmodified work): Add the source-code for this project on opencode.net

5
Score 70.0%
Description:

Notifies you of song changes using native popup dialogs (via org.freedesktop.Notifications if you have it, kdialog if you don't). It is intended as a replacement for the built-in OSD.

If you are looking for notifications using libnotify, look at meerkat's NotifyAmarok: http://www.kde-apps.org/content/show.php/NotifyAmarok?content=103307.



Contact me if you want to add to the existing translations (English, Polish*, Spanish, Italian, Russian, French, German).
Feel free to leave any suggestions or requests.

*diacriticals do not work at this time
Last changelog:

10 years ago

Known Bugs:
- "Resumed Playing" is sometimes triggered when skipping tracks. (it seems trackPlayPause is being called for some reason)
- when a notifiction is reused, it disappears as per the original timeout

0.5:
Since most of the features added here, though significant, I took them from meerkat's NotifyAmarok, I think this partial jump is warranted.
- FEATURE: added new metadata tags (pretty much all the ones there are plus some from NotifyAmarok)
- FEATURE: added option to display album art in notification
- FEATURE: added ability to change paused message independently
- [0.5.1] FIX: now reuses old amaroKnotify notifications (only works with org.freedesktop.Notifications) not until Amarok fully implements its qtscriptbindings and includes some form of QProcess.execute
- [0.5.1] FIX: if the new Notifications interface does not exist, will fall back to kdialog
- [0.5.1] added French translation, courtesy of oboulonis
- [0.5.2] added German translation, courtesy of hoihappen
- [0.5.2] FIX: fixed some problems with non-ASCII characters and kdialog
- [0.5.3] updated Russian translation, courtesy of nu11
- [0.5.3] FIX: untranslated text will now default to English
- [0.5.3] FIX: fixed some more problems with accented characters affecting covers
- [0.5.4] Updated Spanish translations courtesy of Fenix-TX

0.3
- FIX: If you cancel, the configuration dialog does not retain the old settings anymore.
- FIX: If you restart, the duration value is retained.
- FEATURE: Added volume change notification
- FEATURE: added configuration controls for deciding which notifications to receive
- [0.3.1] added Italian translation, courtesy of diegolanteri
- [0.3.2] added Russian translation, courtesy of HucK
- [0.3.3] FIX: stopping or exiting will no longer trigger a notification

0.2
- FEATURE: added localization support (uses the system language, but defaults to English)
- [0.2.1] added Polish translation, courtesy of madsheytan
- [0.2.2] added Spanish translation, courtesy of Fenix-TX

0.1
- Initial Creation

txutxifel

10 years ago

Hello,
I like Amaroknotify, but i think than i found a bug with the accents (á, é, í, ó, ú).When the name or the title of the song has accents, amaroknotify dont show any cover. Its posible than happens with other special characters

Thanks for the script and im sorry for my english

Report

txutxifel

9 years ago

I show that you have just fixed the problem with the accents.

Thanks If you read my message and for make the script!!!!!!!!!

Report

-luk-

10 years ago

Hi, i'm using amarok 2.1.1 and i can't find the configurator. i tryed to search in amarok configuration and in the menus but i dindnt find anything. Have you some ideas?

Report

nu11

10 years ago

Have the same problem with amarok 2.2.0. amaroKnotify is runnting, but no configuration entry in settings menu :(

Report

nu11

10 years ago

Found in debug output:
SCRIPT "amaroKnotify" : "ReferenceError: TEXT_TITLE_HELP is not defined"
I'm using ru_RU.UTF-8 locale, and this string is not defined in russian translation. When using en_US.UTF-8 configuration entry appers in setting menu. Please add this to russian translation file:
const TEXT_TITLE_HELP = "Справка";
This bug can be fixed by loading translation defined by system language, and then english translation to add untranslated entries:
if (QFile.exists(Amarok.Info.scriptPath() + '/' + languageFileName)) {
Importer.include(languageFileName);
}
Importer.include('lang/en.js');

Report

C

thesalus

10 years ago

Ah, that seems to work for me. Thanks for this solution! I will update it soon.

I have also added your translation along with some more I have gleaned from Ubuntu's translation site.

Report

C

thesalus

10 years ago

Hm. That's odd.

It should appear as "Configure amaroKnotify" under the Settings menu. However, it doesn't appear when the script isn't working... are notifications currently appearing when you play songs?

Report

-luk-

10 years ago

yes the notifications are working correctly but in system settings i cant find anything about knotify or amarok.

Report

nqn1976

10 years ago

version 0.5 doesn't work for me in KDE 4.3: when trying to execute db.py manually I get the error:
dbus.exceptions.DBusException: org.freedesktop.DBus.Error.ServiceUnknown: The name org.freedesktop.Notifications was not provided by any .service files

Also, the translation files are missing the TEXT_TITLE_HELP field, this makes the config dialog not appear at all in non-english locales

Report

C

thesalus

10 years ago

Sorry about that.

I updated to 4.3.1 recently, and completely forgot to account for this. If org.freedesktop.Notifications doesn't work, it should go back to using kdialog (which is only missing a little bit of the functionality that switching to this new service allows for). Hopefully this works for you.

And thank you for notifying me, I've updated the translation files with placeholder text.

Report

nqn1976

10 years ago

uhm I spoke too fast... it doesn't work either if the title or the artist have non-ascii characters

Report

nqn1976

10 years ago

Thanks for the quick fix. It works now, but only if "show cover art" is unchecked. I know that knotify can't show images, but it should just ignore that option instead of failing.

Also, a little cosmetic issue: the title of the popup now says "notification from kdialog" instead of "now listening", which looks a little ugly imho.

Report

nqn1976

10 years ago

knotify can't show images
^^^^^
I meant kdialog

Report

ademmer1977

10 years ago

The latest version seems broken, it fails to show a plasma notification and shows a plain notification instead:

http://imagebin.ca/view/XW-0zWUy.html

Any fix for this?

Report

C

thesalus

10 years ago

Unfortunately, I do not know what might be causing this problem. What happens if you try to run db.py manually? Something like:

./db.py "title" "header" "body" 4 1

Any chance that this update fixed it?

Report

ademmer1977

10 years ago

Unfortunally, it's still broken. I tried to run you test command within the script folder, but it complains about an uninitialized key:

---
File "./db.py", line 41, in main
if metadata['arturl'] :
KeyError: 'arturl'
---

I am working on a implementation of my own for a firefox extension. Have a look at the implementation, it works:
http://pastebin.ca/1569320

Maybe you see the differences

Report

finifly

10 years ago

This script is great. I was hoping to find something like this.

Is there any chance that (over time) things like album cover art, and/or music control buttons can be added? Or is that impossible?

Report

C

thesalus

10 years ago

Unfortunately, I cannot find a way to do this just yet with KDE 4.3.

The event method in org.kde.knotify doesn't seem to work, and the org.freedesktop.notification specification is nowhere to be found in qdbus (in fact, I can't seem to find any conclusive information about its status in regards to KDE). If anybody has some information to the contrary, I would be more than happy to listen to it.

Report

diegolanteri

10 years ago

Very useful script, well dome.

On my system the notifications are adding up until their expiring time is up.

For example a volume notification is appearing each 1%, so if I raise the volume by 10% I will have 10 notifications on my screen.

Could you add a function to cancel the previous notification before a new one is displayed?

I've got a translation in Italian where can I send it?

Report

C

thesalus

10 years ago

This is also in response to the previous comment.

I'm glad you found my script useful.

I was thinking of using the dbus interface (particularly org.kde.notify and org.kde.VisualNotifications), but unfortunately, it doesn't seem to work very well from the command line, nor are there qtscript bindings for them. This would fix both problems. If anybody has any advice, please enlighten me (it would be greatly appreciated).

Unfortunately, there is no clean way to cancel notifications, but I'll attempt to address that problem.

Report

rubentm

10 years ago

I love your app. Is there any posibility to show album cover in notification??

Thanks and keep working.

Report

rangerGR

10 years ago

Great plugin.
Is it possible to also show volume level, when changing with mouse wheel over tray icon?

Report

C

thesalus

10 years ago

I was wondering how sought after such a feature would be, but it shouldn't be too much trouble. I just have a few questions I might need a bit of feedback on.

1. What would be the best way to visually display this information, though? Here are the methods I was considering:

38/100
[::::::|||] 38 [||||||||:]
[ 38/100] [|||:::::::]

(spaces don't appear well in kdialog)

2. Would it be worthwhile to note whether this was an increase or a decrease?

Thank you for your suggestion.

Report

rangerGR

10 years ago

1. Amaroks OSD shows
"Volume 38%"
and I believe that's fine.

2. I don't think this is so important. Only the volume level is enough. Simple, as the default OSD.

Report

meerkat

10 years ago

Hi, just saw that we nearly simultaneously released similar scripts, but luckily used different (turned) names. I like the configurability of yours, maybe i'll adept that for my libnotify version.

Report

10 years ago

Known Bugs:
- "Resumed Playing" is sometimes triggered when skipping tracks. (it seems trackPlayPause is being called for some reason)
- when a notifiction is reused, it disappears as per the original timeout

0.5:
Since most of the features added here, though significant, I took them from meerkat's NotifyAmarok, I think this partial jump is warranted.
- FEATURE: added new metadata tags (pretty much all the ones there are plus some from NotifyAmarok)
- FEATURE: added option to display album art in notification
- FEATURE: added ability to change paused message independently
- [0.5.1] FIX: now reuses old amaroKnotify notifications (only works with org.freedesktop.Notifications) not until Amarok fully implements its qtscriptbindings and includes some form of QProcess.execute
- [0.5.1] FIX: if the new Notifications interface does not exist, will fall back to kdialog
- [0.5.1] added French translation, courtesy of oboulonis
- [0.5.2] added German translation, courtesy of hoihappen
- [0.5.2] FIX: fixed some problems with non-ASCII characters and kdialog
- [0.5.3] updated Russian translation, courtesy of nu11
- [0.5.3] FIX: untranslated text will now default to English
- [0.5.3] FIX: fixed some more problems with accented characters affecting covers
- [0.5.4] Updated Spanish translations courtesy of Fenix-TX

0.3
- FIX: If you cancel, the configuration dialog does not retain the old settings anymore.
- FIX: If you restart, the duration value is retained.
- FEATURE: Added volume change notification
- FEATURE: added configuration controls for deciding which notifications to receive
- [0.3.1] added Italian translation, courtesy of diegolanteri
- [0.3.2] added Russian translation, courtesy of HucK
- [0.3.3] FIX: stopping or exiting will no longer trigger a notification

0.2
- FEATURE: added localization support (uses the system language, but defaults to English)
- [0.2.1] added Polish translation, courtesy of madsheytan
- [0.2.2] added Spanish translation, courtesy of Fenix-TX

0.1
- Initial Creation

12345678910
4
product-maker e1nste1n Jun 14 2011 9 excellent
product-maker delian Jun 07 2011 9 excellent
product-maker Keksbubi Apr 29 2011 9 excellent
product-maker Razor13 Mar 24 2011 9 excellent
product-maker Base: 4 x 5.0 Ratings
DaiVied
Dec 30 2009
mdye
Sep 30 2009
-luk-
Sep 16 2009
apolodor
Sep 16 2009
gskbyte
Aug 14 2009
File (click to download) Version Description Downloads Date Filesize DL OCS-Install MD5SUM
*Needs pling-store or ocs-url to install things
Pling
0 Affiliates
Details
license
version
0.5.4
updated Sep 16 2009
added Apr 20 2009
downloads 24h
0
pageviews 24h 4
System Tags addon