User:Aidosl/Notifications in your plasmoid

From KDE TechBase

We're going to make putting notifications in your plasmoid as easy as 1-2-3 using KNotify!

Creating Your Notifications

The .notifyrc file contains the names and actions of your notifications. It looks similar to a .desktop file. We give each notification a descriptive name, and then select from a list of predetermined actions (and maybe add some other attributes).

Including Your Notifications

Now we need to edit our CMakeLists.txt--it needs to know to include the .notifyrc file. Just add another include with the name of the file and a title to reference it by.

Invoking Your Notifications

Now we need code. Make a notification, give it some text, maybe give the user some actions, and give it a test!

Bonus! Configuring Your Notifications

That's great that we've given the users notifications, but one of the best parts of KNotify is that it allows the user decide what warrants a notification and how they are notified. Right now, everything is decided by the .notifyrc file, and that's just not very user-friendly.

More Examples

Take a look at the Pastebin applet and Kopete for KNotify in action!