There is something very exciting I have to show to you today: a completely rewritten notification system for Plasma that will be part of our next feature update 5.16 to be released in June.

Isn’t that an update you’d love to install?

I have been planning to do this rewrite for years. In fact, the wiki page where I collected ideas and mock-ups was created in July 2016 and “assumes the status quo as of Plasma 5.7”. The old notification plasmoid was originally written in 2011, when QML was still pretty new. It later got ported to Plasma 5 and slightly overhauled, most noticeably using individual popups rather than the scrolling ticker of notifications we had in the late Plasma 4 days. However, its core logic hardly changed and it became evident that its code base could not support many of the feature users expect from a notification center these days. I had started a rewrite branch last summer but only recently found the time and motivation to finish it and basically hacked on that thing for a month straight, and here’s what came out of that:

New look and feel

The first thing you’ll notice is that the notifications are much more compact with the icon on the opposite side now and the issuing application prominently displayed. Font sizes have also been streamlined and the heading is now allowed to wrap. A major behavior change in the new system is that persistent notifications stay on screen until dismissed. This ensures that important notifications and ones that require user interaction, such as a pairing request from a Bluetooth or KDE Connect device don’t go unnoticed.

Notification popup synced from your phone indicating what app and device it originally came from

When an application sets a “default” action, the cursor changes to a pointing hand to indicate that the popup itself is clickable. A little bar on the side indicates when the notification will time out. I worked together with Nicolas Fella of KDE Connect fame to improve the user experience when syncing your devices and it will soon be possible for it to annotate a notification with the name of the device it originally came from and the actual app on the device that sent it.

My all time favorite productivity feature in Plasma, notification thumbnails, has of course been touched up. It now uses a better aspect ratio and has a lovely blur effect to go with it. In case you didn’t know: when you take a screenshot in an application like Spectacle (remember Meta+Shift+Print Screen) or Flameshot you can drag the screenshot preview in the notification anywhere you like, for example your web browser, or an email composer.

Screenshotception.

Do not disturb mode

Choose how long you want to be left alone

Do not disturb mode engaged

Another new major feature is “Do not disturb” mode. When enabled, no notification popups are shown and the Notification Sounds stream is muted. All notifications go straight to the history for later reference.

However, there are some notifications that should get through nonetheless. This is why the new server also supports the “Urgency” hint which an application can use to specify whether a notification has low, normal (the default), or critical urgency. Critical notifications, such as your battery is about to die, are shown even in do not disturb mode. KDE applications can now add a Urgency= key to an event in their .notifyrc file or use the setUrgency method on KNotification added in the upcoming Frameworks release. Moreover, you can specify which applications are allowed to send notifications regardless.

There is currently a discussion on the XDG mailing list about a DBus protocol for notification inhibitions so applications like LibreOffice Impress, Okular, OBS, and others could automatically enable this mode when giving a presentation or hosting a livestream. Speaking of presentations, while regular notifications aren’t shown on top of full-screen windows for added privacy, critical notifications will be, so you won’t miss your laptop running out of juice mid-lecture.

Progress reporting

Progress reporting when copying or receiving files has also been revamped and uses the same style as notifications. A more useful summary text is displayed, showing the most important information at a glance: the name of the file or number of files being processed as well as the destination and time remaining. This way you never actually have to expand the details section to see what’s going on. You still can, of course.

Copying multiple files

Finished copying a single file

Downloading stuff

When a job finishes it turns into a regular notification and just times out. In case of error it stays visible so you can investigate what went wrong. One major complaint we got with the old progress reporting was that it’s easy to miss since it’s just a little circle in the panel. To address this, by default the job popup opens and stays there until the task has finished. It can be manually hidden at the click of a button and there’s an option to automatically do that a few seconds into the progress, if you prefer that.

Notification history

Notification history showing what you’ve missed

An always only half-hearted feature was the notification history. Currently it collects every notification and gets cluttered quickly. In the new history, we try to reduce the amount of spam that piles up: notifications that you explicitly closed, interacted with, or that got revoked by the issuing application aren’t added to the history. Unfortunately, with the freedesktop Notification protocol and how KNotification is built around that a proper history isn’t possible: an application cannot revoke a notification once it expired even if it afterwards knows it became obsolete.

To remedy the effects of piling up old notifications they are grouped by application and only the last couple of notifications are shown, with the possibility to expand a group to show all of them. Additionally, low urgency notifications, which could be your media player changing tracks, aren’t added to the history by default.

New settings module

What would be a new feature in KDE land without settings? ;) Accompanying the new notification server and plasmoid is an all-new System Settings module.

New notification settings module

It lets you configure various aspects of notifications and job reporting in a central place. Settings for badges (the little number circle on app icons) and application progress in task manager have also been moved to this central location. Furthermore, the default popup time out, i.e. when an application doesn’t explicitly specify one, is now a fixed number of seconds. The old implementation tried to find a sensible timeout based on the number of words and an “average read speed” but its inaccurate algorithm often lead to popups staying on screen a long time for no apparent reason.

Configuring notifications, including Gnome applications and other 3rd party ones

While it has always been possible to configure notifications of KDE’s own applications to a great degree, there was no way to influence the behavior of 3rd party apps. The new settings module is able to find Gnome applications that set the appropriate hint as well as remember any application that sent a notification in the past.

This allows you to disable popups for those applications, too, as well as keep them out of your notification history or white-list them for do not disturb mode. The fine-grained notification event configuration for KDE applications is also still available.

Give it a try!

There’s a couple of days left until Plasma 5.16 Beta, to be released on 16 May, so there’s still some time for you to try it out beforehand and give feedback. With the new implementation I managed to fix almost 20 distinct bug reports. Go spin up your developer machine and build plasma-workspace master branch from git. You may also update your favorite distribution sporting daily builds, however, the feature has only been merged recently, so it might take some time for updated packages to be generated.

If you find a notification that looks odd or different from how it used to, do tell me! Ideally, you’ll be monitoring DBus traffic to find out what exact notification and data the application sent and help me reproduce and fix the issue. Just run

dbus-monitor interface=org.freedesktop.Notifications

to see all traffic going in and out of the notification server, or use a tool like Bustle. For debugging progress reporting, the interfaces instead are org.kde.kuiserver, org.kde.JobViewServer, and org.kde.JobViewV2. There’s also a debug logging category org.kde.plasma.notifications that you can enable through kdebugsettings.