Skip to main content

Crate krateio

Crate krateio 

Source
Expand description

Show job progress in the Plasma notification area.

krateio talks to the KDE JobView D Bus protocol that Plasma uses to display long running jobs such as file transfers or package installs. It prefers the JobViewServerV2 protocol from Plasma 6 and falls back to the older JobViewServer protocol when V2 is not available.

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()?;

job.set_description(1, "Package", "firefox")?;
job.progress(krateio::Unit::Items, 3, 10)?;

if job.cancel_requested() {
    job.fail(1, "Cancelled by user")?;
} else {
    job.finish()?;
}

Structs§

Job
Handle for a job shown in the Plasma notification area.
JobBuilder
Configures a job before it is shown.
Tracker
Entry point that connects to the session bus and creates jobs.

Enums§

Error
The error type for zbus.
Unit
Measurement unit for job amounts.

Type Aliases§

Result