statusnotifier: KDE's Status Notifier Item as GObject
Latest version: 1.0.0
You can find the source code on this GitHub, where you can also report bugs, send suggestions or other (constructive) feedback.
What is statusnotifier ?
As it was reported to me that kalu wouldn't work with Plasma Next, since it relies on a systray icon, I started looking into it. Unfortunately, I couldn't find a way to use this interface the way I needed to -- the only library that seemed to support it was Ubuntu's libappindicator (watch out, that page is full of dead links!), but it seemed rather limited.
So, I eventually decided to write my own, and this is the result. This little library allows to easily create a GObject to manage a StatusNotifierItem, handling all the DBus interface and letting you simply deal with the object's properties and signals.
You can simply create a new StatusNotifierItem using one of the helper function,
status_notifier_item_new_from_icon_name(), or simply creating an object
as usual - you then just need to make sure to specify property
- sn = (StatusNotifierItem *) g_object_new (STATUS_NOTIFIER_TYPE_ITEM,
- "id", "app-id",
- "status", STATUS_NOTIFIER_STATUS_NEEDS_ATTENTION,
- "main-icon-name", "app-icon",
- "attention-icon-pixbuf", pixbuf,
- "tooltip-title", "My tooltip",
- "tooltip-body", "This is an item about <b>app</b>",
You can also set properties (other than
id) after creation. Once ready, call
status_notifier_item_register() to register the item on the session bus and to
If an error occurs, signal
registration-failed will be emitted. On success,
state will be
Once registered, you can change properties as needed, and the proper DBus
signal will be emitted to let visualizations (hosts) know, and connect to the
signals (such as
context-menu) which will be emitted when the corresponding
DBus method was called.
Simple as that.
Everything should be pretty straightforward, and it comes with HTML documentation to help, as well as a basic example of use. Feel free to ask/comment though, of course.