OpenSource programming

April 10, 2008

Plasmoiding notifications and notificating plasmoids

Filed under: General — Dmitry @ 3:12 pm

Ok, I finally got to blog about the stuff I was doing lately πŸ™‚

As I wasn’t quite satisfied with the current visual representation on KDE notifications (KNotify uses KPassivePopup ATM), I decided to try to improve them. Also, hearing all the buzz about plasma I was interested to see how it works and to play with it. And so I went to #plasma, asking for advice on how would it best to proceed with giving more cutie look to KDE notifications πŸ™‚
Aaron immediately suggested me a nice way to go, explained me some details, pointed to the existance of galago spec – so thanks, Aaron! πŸ™‚

I think I’ll start my short description of what have been done with a screenshot:

Notify plasmoid

What you can see above is the very beginnings of the Notify plasmoid – which is capable of showing notifications. It is by no means finished, but it already supports clicking on that “action links” so you’re able to open a new chat :). Also as you can see on second notification – the applet supports showing “timing out” state of notifications – there’s an animated circle that gets sliced as notification’s timeout expires.

Now about how this is works:
I developed a Plasma DataEngine which implements (to some extent) a Galago project’s Desktop Notifications DBus interface. And also I patched KNotify’s NotifyByPopup plugin to forward notifications to this DBus interface when it exists and to fallback to passive popups if DBus interface doesn’t exist. This was what aseigo suggested and it works fine. So here’s a workflow on how things might work on a someone’s system:

– KDE session is started, bringing up KNotify
– KNotify searches for org.kde.Notifications DBus interface, doesn’t find one, so it uses passive popups
– User adds a Notify plasmoid to desktop: plasmoid instanciates its DataEngine which makes org.kde.Notifications appear on a session bus
– KNotify notices this and starts to forward its popups to org.kde.Notifications and stops showing passive popups
– Notify applet reacts on data changes in DataEngine and provides visualizations for coming notifications
– If user clicks on some action in notification in plasmoid, the DBus signal is emitted – KNotify reacts on it by performing assosiated action
– User removes a Notify plasmoid: DataEngine gets destroyed, org.kde.Notifications gets unregistered from session bus.
– KNotify notices this and starts showing passive popups as usual

Nice, isn’t it?
Even more: after patching KNotify, it will be able to use *any* implementation of Galago spec, not necessarily this plasma one.
And therefore notifications might be shown using a native user environment.

So as basic things of DBus interface are now implemented, next will come improvements on visual side – plasma artists will eventually provide me with an applet mockup, so I can make it more good looking and behaving πŸ™‚
Also in #plasma we discussed some ideas about making it an extender in future (Hi, pinda!)

I’m also thinking about merging my KNotify improvements back in trunk eventually – they’re not very obtrusive as they simply add a couple of new methods to NotifyByPopup plugin.
And KNotify continues to work as it does now, unless DBus interface org.kde.Notifications will be found.
I wonder when it will be best to do this merge – as I consider KNotify part mostly complete (of course I’ll post a patch for review on k-c-d prior to merging)

Last but not least, thanks to Thiago and all who worked on QtDBus – it proved to be simple enough to learn and use even for such a newbie as me, who wasn’t experienced with DBus at all πŸ™‚
Ah, and of course, techbase tutorials are very nice – thanks for them too! πŸ™‚

Advertisements

25 Comments »

  1. Thank you, that is very cool! I always liked the desktop notifications dbus interface and notification-daemon, but had some problems with them on my multimonitor setup, but looking forward to my gtk im client (gajim) delivering notifications thru plasma!

    Comment by IAnjo — April 10, 2008 @ 3:44 pm

  2. now we just miss the extenders πŸ™‚

    Comment by marc — April 10, 2008 @ 3:45 pm

  3. looks great πŸ™‚
    but what is an extender ?

    Comment by Heller — April 10, 2008 @ 3:54 pm

  4. Very cool, Dmitry! πŸ™‚

    Comment by Erlend — April 10, 2008 @ 4:04 pm

  5. @IAnjo:
    Great! Would be nice, indeed πŸ™‚

    @marc:
    There was a GSoC proposal regarding them, so if it gets accepted we’ll see them implemented sooner than if it won’t πŸ˜‰

    @Heller:
    You can read about them here: http://plasma.kde.org/cms/1069

    @Erlend:
    thanks πŸ™‚

    Comment by Dmitry — April 10, 2008 @ 4:08 pm

  6. Why not have all the applications publish notifications using Galago? why does KNotify need to be there at all for pop up messages?

    I am not asking for it to be done, I just want to know why.

    Comment by Paul — April 10, 2008 @ 4:45 pm

  7. What I wonder how this could be modified to deal with a lot of notifications within a very short time. You know kontact/kmail showing its progress when you check mails in many folders/accounts simultaneously? It would be nice if your notifier plasmoid wouldn’t clutter the whole desktop from bottom to top if there are a lot of notifications. So it would maybe try to overlap the newest notifications as long as the one that is currently shown is still active. Would it be possible to get a nice default behaviour depending on how many notifications are to be shown? (So let’s say up to three notifications can be shown simultaneously, more are shown subsequently, e.g.)

    Comment by Patrick — April 10, 2008 @ 5:06 pm

  8. @Paul:
    Several reasons:
    – Galago was invented only recently. Moreover, it has some issues. Aaron wrote several improvements suggestions to xdg list
    – KNotify is not only about popups – it provides several ways to notify user. Popups is just one of them.

    @Patrick:
    Yes, I thought about all this too. That’s why I wrote that applet is in an early state and that plasma people are working on a mockup that will address issues you mention. I guess it’ll be scrollable in some nice and easy way. Or maybe we’ll come up with some other neat idea πŸ™‚ Do not worry, i’m not going to allow it to clutter your whole desktop (and mine too) πŸ˜‰

    Comment by Dmitry — April 10, 2008 @ 5:09 pm

  9. Sounds very cool – any chance to intercept messages (“popups”) from other applications? Like Gnome apps or 3rd party apps like Skype?

    Comment by liquidat — April 10, 2008 @ 5:58 pm

  10. If you’re happy that it’s safe (ie: it won’t swallow notifications if people don’t have the plasmoid), then I’d post it to k-c-d. The freezes for 4.1 are going to start hitting soon, and people will be less willing to have it in the nearer it gets to the release.

    Comment by randomguy3 — April 10, 2008 @ 6:12 pm

  11. @liquidat:
    Yep. This is the one of the cool benefits that you’ll get for free. Because it’s a DBus interface πŸ™‚
    So any app that knows how to use it will be able to send notifications to this applet – be it gnome apps, skype or you using some command line tool like qdbus πŸ™‚
    Schematically it looks like <SOME_APP> => DBus => Plasmoid.
    In the post above SOME_APP is KDE’s KNotify πŸ™‚ but it’s not limited to be KNotify only.

    @randomguy3:
    ok. I just not that familiar with freezes πŸ™‚ You mean feature freeze?

    Comment by Dmitry — April 10, 2008 @ 6:13 pm

  12. This looks awsome!

    The other days kde4/kopete-kde4 ate all my offline messages for about 1 whole week and I was very upset & annoyed about it, I’m still am 😦

    Hope to see this soon in my kde4! Cheers!

    Comment by Dread Knight — April 10, 2008 @ 6:23 pm

  13. Hi dimsuz! Nice to see your notify plasmoid shaping up, the way it looks now it’s already a massive improvement over the Kpassivepopup unit which look very out of place among all the plasma and oxygen goodness. Not to mention that this approach is a lot more flexible then the passive popups (different notification applets to choose from…. extenders… cool stuff).
    I’m interested to see what the plasma/oxygen artists can make of it… please keep us informed. πŸ™‚

    Comment by pinda — April 10, 2008 @ 7:32 pm

  14. @Dread Knight:
    Yeah, I guess that was upsetting πŸ™‚
    Cheers!

    @pinda:
    Yep. Of course πŸ™‚

    Comment by Dmitry — April 10, 2008 @ 7:42 pm

  15. Wow! That is something I was waiting for! Notifications in KDE were really ugly and annoyed me. Now, with the power and flexibility of Plasma everything will be just beautiful… πŸ™‚

    Comment by krzych — April 10, 2008 @ 10:39 pm

  16. “What I wonder how this could be modified to deal with a lot of notifications within a very short time. You know kontact/kmail showing its progress when you check mails in many folders/accounts simultaneously? ”

    These are progress indicators, not notifications. If they would appear anywhere other than Kontact, it would be in the kuiserver Job Progress Viewer.

    Comment by Anon — April 10, 2008 @ 11:38 pm

  17. Interesting stuff, from a technical POV.

    However, I’m not quite sure I like the underlying idea. From my understanding, if an application needs to show a notification, that’s usually because it has something important to say. Now, shouldn’t such important info be displayed in such a way that it seems “attached” to its source (i.e: on a modal pop-up on top -or at least close- to the app, on a roll-down sheet, as in OS X, on a globe growing out of a minimized systray icon…)?

    To give you a more mundane example: if we both were in a busy room and you had something important to tell to me, would you rather come up to me and say it on my face, or go to some “centralized” pinboard and tack a note on it, hoping that I will keep a constant eye on that board and read your note?

    While centralized notifications sound cool, pop-ups and modal windows were devised for a reason. The kind of use I envision for this technology is better suited for background processes that don’t have a direct representation in the GUI, eg: “a system daemon has crashed”, “the computer is going down in 5 min.”, “new updates are available”, etc.

    In the same line, another interesting use case would be using the galago API for different kinds of notification “proxies”. One such proxy could be made to forward important notifications to remote locations, eg: by sending a SMS to a cell phone, to a central management console, or even to a “notification plasmoid” on the network administrator’s PC.

    But I realize I’m talking a much greater scope here.

    My 2 cents.

    Comment by tecnocratus — April 11, 2008 @ 11:53 am

  18. Here’s another crazy idea -guess I had too much coffe in the morning-:)

    Since notifications consist mainly of… ehm… *NOTES*, why not just use the Notes (post-it) plasmoid for it???

    Yes, that means displaying system notifications on post-it notes, literally.

    You guys could work together to make the Notes data engine galago-aware. Of course, some refinement would be needed. For instance, the Notes plasmoid would need to be able to live on the panel as a minimized icon. In this case, notifications would be better presented using a extender, much like the one you have created.

    Even crazier: wouldn’t it be uber-cool to have post-it notes that attach to the originating application windows??? (I’m not a programmer, so I don’t know how difficult it would be to implement)

    Comment by tecnocratus — April 11, 2008 @ 12:15 pm

  19. Hi, this plasmoid looks great. I hope this will be in kde 4.1.
    I’d like to propose few things.
    It would be nice to give some (configurable) action clicking on the application icon on the left. Moreover I think it would look nicer if all links (like read, view, ignore) are alinged to the bottom without underline (the different text color hints that they are links).

    Comment by Zsolt — April 11, 2008 @ 1:17 pm

  20. @tecnocratus:
    First: I think you missed the point a little. The thing is that it’s the application which decides whether to show message using this notifications system or in some other way. Usually such notifications are used for showing not very important *status information*. For something that user shouldn’t miss in any case, applications usually show message boxes. Of course, there’s a way to attach some actions to popup-notification, but again – it is up to application to choose *how* to notify the user and if he can potentially miss this notification.
    So what concept do you see as broken? πŸ™‚
    Second: What makes you think that notifications aren’t attached to the application which issued it? Did you notice that each notification has a rather big icon and the app name on the left? πŸ™‚

    Your second suggestion also doesn’t make sense to me (sorry πŸ˜‰ ). You see, notifications and notes are quite different beasts :). Notes is for something that you want to remember later, notifications is for something like “see this info and forget”. An analogy would be something like this: notes is what you write on a sheet of paper, notifications is like telling your girlfriend: “look what beautiful bird just flew there! isn’t it nice?… Ok, let’s now walk to those trees…” πŸ™‚

    @Zsolt:
    Thanks for your suggestions! Note that the current design is likely to receive major rework, so stay tuned πŸ˜‰

    Comment by Dmitry — April 11, 2008 @ 3:32 pm

  21. […] possibilities include a kuiserver applet that shows running file transfers, a system notifier applet that uses exenders so you could for example detach a received email by dragging it and dropping it […]

    Pingback by GSoC extenders project « pindaBlog — April 23, 2008 @ 11:59 pm

  22. Any news ? Do you realize that millions (yep, millions) of people are waiting for your work ?! :p

    Cheers πŸ™‚

    Comment by DanaKil — June 7, 2008 @ 12:46 pm

  23. Hehe. Thanks πŸ™‚

    Well, news are that this applet is already somewhat functional – i’m able to use it in my daily work. and i must say i like it a lot πŸ™‚
    Ricardo made a nice mockup for me and i’m doing my best to implement it. It looks quite different from what is on a screenshot above – a lot more beautiful πŸ™‚ I’d say it’s finished for about 60% – it lacks animations atm and has some other more or less serious issues, but again – it’s quite usable πŸ™‚

    I don’t blog about my progress, because I’d wanted to do that after some more things will be finished.
    The code is in playground/base/plasma – if you have SVN checkout you can easily try it.

    Comment by Dmitry — June 7, 2008 @ 12:55 pm

  24. Looking forward to seeing this too πŸ™‚ One of the little things that bug me is having application notifications displayed in different places, styles, etc. – both because it’s fugly and because quite often it means keeping a system tray icon purely for the purpose. Having a central notification icon that can pop out as needed is awesome.

    Thanks for working on this πŸ™‚

    Comment by Martin Fitzpatrick — August 8, 2008 @ 8:25 pm

  25. I managed to check out the source, but can’t get it to compile. Are there any installation/build instrutctions or any other way to test this?

    thx a dozen!

    Comment by Bastian Kennel — August 11, 2008 @ 11:41 am


RSS feed for comments on this post. TrackBack URI

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Blog at WordPress.com.

%d bloggers like this: