notify-rust 0.0.7

Show desktop notifications. Similar to libnotify, but pure rust.
Documentation

notify-rust

Build Status

Shows desktop notifications. This implementation does not rely on libnotify, as it is using dbus-rs. Basic notification features are supported, more sophisticated functionality will follow. The API shown below should be stable.

#Cargo.toml
[dependencies]
notify-rust = "*"

Usage

extern crate notify_rust;
use notify_rust::Notification;
fn main()
{
    // use it this way
    Notification::new()
        .summary("this is the summary")
        .body("this is the body")
        .icon("firefox")
        .timeout(6000) //miliseconds
        .show();

    // using format!()
    Notification::new()
        .summary("Chromium Crashed")
        .appname("chromium")
        .body(&format!("This is <b>{}</b>!<br/>", "a lie"))
        .icon("chromium")
        .timeout(6000) //miliseconds
        .show();

    // possible, if you like
    let mut message = Notification::new();
    message.summary("invocation type 2");
    message.body("your <b>body</b> is a <u>wonderland</u>");
    message.show();

    // also possible, if you really really want to
    Notification {
        appname: "foobar".to_string(),
        timeout: 20,
        ..Notification::new()
    }.show();



    // can't see anything?
    Notification::new().summary("this will also print to stdout").show_debug();


}

Documentation

http://hoodie.github.io/notify-rust/

Things TODO

  • actions
  • hints
  • make use of returned id (can be used by close_notification(id))
  • implement methods: GetServerInformation()
  • listen to signals: ActionInvoke (0.0.8 to 0.0.9)
  • become good enough to make this list

check out the specifications