Taskbar badge notifications for KDE Plasma 6.
- Rust 98.6%
- Makefile 1.4%
| src | ||
| tests | ||
| .gitignore | ||
| Cargo.lock | ||
| Cargo.toml | ||
| LICENSE | ||
| Makefile | ||
| plasma-task-manager-notifications.service | ||
| README.md | ||
Plasma Task Manager Notifications
Taskbar badge notifications for KDE Plasma 6. Dynamically discovers running applications via KWin, monitors desktop notifications via D-Bus, and sets badge counts on taskbar icons using the Unity Launcher API.
How it works
- Discovers apps dynamically by querying KWin via D-Bus — enumerates open windows using
WindowsRunner.Match, then callsKWin.getWindowInfofor each to get thedesktopFileproperty. Rediscovers every 30 seconds in a background thread. - Runs an unfiltered
dbus-monitor --sessionsubprocess (unfiltered is required to capture method return messages which contain the assigned notification ID). - Parses the dbus-monitor output as a stream, tracking three message types:
method_callwithmember=Notify— extract theapp_nameand messageserialmethod_returnwith matchingreply_serial— extract the notification IDsignalwithmember=NotificationClosed— notification was dismissed
- Matches
app_name(case-insensitive) against the dynamically discovered app map. Also supports Flatpak apps viadesktop-entryhints. - Emits
com.canonical.Unity.LauncherEntry.Updatesignals viagdbus emitto set/clear badge counts and theurgentflag on the corresponding taskbar icon. - On shutdown (SIGINT/SIGTERM), clears all badges.
Requirements
- KDE Plasma 6 with KWin and Task Manager
dbus-monitor(fromdbus-tools, typically pre-installed)gdbus(fromglib2, typically pre-installed)- Rust toolchain (to build)
Install
git clone ssh://git@git.nmm.ee/asko/plasma-task-manager-notifications.git
cd plasma-task-manager-notifications
make install
This installs the binary to ~/.local/bin/ and the systemd service to ~/.config/systemd/user/.
Enable at login
systemctl --user enable --now plasma-task-manager-notifications.service
Check status
systemctl --user status plasma-task-manager-notifications.service
journalctl --user -u plasma-task-manager-notifications.service -f
Uninstall
make uninstall
Usage
Run manually (logs to stderr):
plasma-task-manager-notifications
Test with a sample notification:
notify-send --app-name=firefox "Test" "Badge should appear"
Development
cargo test # run all tests
cargo build # debug build
make build # release build
Architecture
The crate is split into four modules:
| Module | Purpose |
|---|---|
parser |
Streaming parser for dbus-monitor text output |
app_map |
Tracks discovered apps, pending notifications, and active badge counts |
discovery |
Queries KWin D-Bus interfaces to discover running apps and their desktop file IDs |
badge |
Emits Unity LauncherEntry Update signals via gdbus |
All modules are designed for testability — external D-Bus calls are injected as function parameters in tests.
Known limitations
- Processes all session bus traffic (unfiltered monitor). Lightweight in practice but could theoretically be optimized with
BecomeMonitorD-Bus API. - Only badges apps that currently have an open window. Pinned taskbar icons without a running instance won't be badged.
- If two apps share the same last dot-segment in their desktop file ID, they would collide in the match map. Unlikely in practice.
- Firefox web app notifications all badge under the single Firefox icon.
- Notifications that expire via timeout also emit
NotificationClosed, so badges clear when notifications auto-dismiss.
License
MIT