![]() Registered Member ![]()
|
Could someone please give me an example of how to change the icon when showing a knotify message via dbus?
It should be the chronometer-icon. The code is part of a plasmoid using python.
BTW: Is there a possibility to mute the sound of this single notification? KDE version: 4.8.5 Kubuntu 12.04 |
![]() Administrator ![]()
|
Unfortunately the only way to mute it would be by using the native KNotification infrastructure, which is provided via the PyKDE4 bindings - as this allows for notifications to be extensively customised.
In terms of setting the icon to be used, it appears the API you are using requires a pixmap to be passed along. You will need to use KIcon to load the icon you need in question, and then pass along the appropriate binary data from that. You might also want to set "plasma-desktop" as the application name, rather than "kde".
KDE Sysadmin
[img]content/bcooksley_sig.png[/img] |
![]() Registered Member ![]()
|
The above code gives the message:
Changing "kde" to "plasma-desktop" does nothing. No notification or error comes up. I am rather a novice in KDE programming and python. |
![]() Administrator ![]()
|
You might find http://www.qtcentre.org/threads/2037-Co ... QByteArray to be of use - although that is C++ code you will need to port into the Python equivalent.
KDE Sysadmin
[img]content/bcooksley_sig.png[/img] |
![]() Registered Member ![]()
|
I've found the solution here: http://qt-project.org/doc/qt-4.8/qpixmap.html#save-2
I've got the bytearray with the following steps:
|
Registered users: Bing [Bot], blue_bullet, Google [Bot], Yahoo [Bot]