#desktop #notification #notify #linux #macos

notify-rust

Show desktop notifications (linux, bsd, mac). Pure Rust dbus client and server.

40 releases (26 stable)

4.0.0 Jun 6, 2020
4.0.0-beta.3 Mar 11, 2020
4.0.0-alpha.3 Dec 7, 2019
4.0.0-alpha.2 Nov 20, 2019
0.9.0 Jun 30, 2015

#4 in Unix APIs

Download history 2527/week @ 2020-06-01 2595/week @ 2020-06-08 3069/week @ 2020-06-15 3613/week @ 2020-06-22 2979/week @ 2020-06-29 4057/week @ 2020-07-06 3248/week @ 2020-07-13 3297/week @ 2020-07-20 3294/week @ 2020-07-27 2743/week @ 2020-08-03 3417/week @ 2020-08-10 3867/week @ 2020-08-17 3275/week @ 2020-08-24 3679/week @ 2020-08-31 3485/week @ 2020-09-07 3274/week @ 2020-09-14

6,537 downloads per month
Used in 45 crates (40 directly)

MIT/Apache

80KB
1.5K SLoC

notify-rust

Travis Crates.io contributors maintenance

version documentation license

A not so well-named library for displaying desktop notifications.

[dependencies]
notify-rust = "4"

Usage & Documentation

Please see the documentation for current examples.

Simple Notification

use notify_rust::Notification;
Notification::new()
    .summary("Firefox News")
    .body("This will almost look like a real firefox notification.")
    .icon("firefox")
    .show()?;

Persistent Notification

use notify_rust::{Notification, Hint};
Notification::new()
    .summary("Category:email")
    .body("This has nothing to do with emails.\nIt should not go away until you acknowledge it.")
    .icon("thunderbird")
    .appname("thunderbird")
    .hint(Hint::Category("email".to_owned()))
    .hint(Hint::Resident(true)) // this is not supported by all implementations
    .timeout(0) // this however is
    .show()?;

Commandline tool

Checkout toastify, it exposes most of the functionality of the lib to the commandline.

Requirements

  • rustc >= 1.44
  • libdbus (linux)

macOS support

This library shines on linux and bsd, which is its original target platform. Lately it gained support for macOS thanks to mac-notification-sys. However this only includes a small subset of the current functionality, since NSNotifications don't have as many features. Please refer to the You are a versed macOS UI developer with mad Objective-C skillz? PRSV.

windows support

Similar to macOS we support windows via the help of winrt-notification.

Contribution

Any help in form of descriptive and friendly issues or comprehensive pull requests are welcome!

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in notify-rust by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.

Conventions

The Changelog of this library is generated from its commit log, there any commit message must conform with https://www.conventionalcommits.org/en/v1.0.0/. For simplicity you could make your commits with convco.

Dependencies

~0–0.9MB
~18K SLoC