krateio 1.0.0

Show job progress in the Plasma notification area via the KDE JobView D-Bus protocol
Documentation
  • Coverage
  • 86.49%
    32 out of 37 items documented1 out of 32 items with examples
  • Size
  • Source code size: 61.1 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 602.0 kB This is the summed size of all files generated by rustdoc for all configured targets
  • Ø build duration
  • this release: 21s Average build duration of successful builds.
  • all releases: 21s Average build duration of successful builds in releases after 2024-10-23.
  • Links
  • Repository
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • koyuawsmbrtn

krateio

Rust library for showing job progress in the Plasma notification area, the same popups KDE uses for file transfers. Built for tools like package managers that want desktop progress reporting without linking Qt.

It speaks the KDE JobView D-Bus protocol directly over zbus. The modern org.kde.JobViewServerV2 protocol (Plasma 6) is preferred, with automatic fallback to the legacy org.kde.JobViewServer protocol.

Usage

let tracker = krateio::Tracker::new("org.blossomos.pkglayer")?
    .with_app_name("Package Manager")
    .with_app_icon("system-software-update");

let job = tracker
    .job()
    .title("Installing packages")
    .cancellable(true)
    .start()?;

for (i, package) in packages.iter().enumerate() {
    if job.cancel_requested() {
        return job.fail(1, "Installation cancelled");
    }
    job.set_description(1, "Package", package)?;
    job.progress(krateio::Unit::Items, i as u64, packages.len() as u64)?;
    install(package)?;
}

job.finish()?;

Run the demo against a live Plasma session:

cargo run --example demo

Features

  • Title, status message, percentage, speed, and processed/total amounts (bytes, files, directories, items)
  • Two description rows for details such as the current package name
  • Cancel and suspend requests from the popup, exposed as polled flags
  • Transient and immediate display hints
  • Jobs terminate cleanly on drop

Requirements

A session bus with a JobView server, normally provided by plasmashell. No KDE or Qt libraries are required at build or run time.

License

MIT