Thanks to visit codestin.com
Credit goes to github.com

Skip to content

☝️Send Desktop Notifications on linux and bsd

Notifications You must be signed in to change notification settings

hannesg/notify-rust

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

217 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

notify-rust

license version

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 = "3.0"

Examples

Example 1 (Simple Notification)

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

Example 2 (Persistent Notification)

use notify_rust::Notification;
use notify_rust::NotificationHint as Hint;
Notification::new()
    .summary("Category:email")
    .body("This has nothing to do with emails.\nIt should not go away until you acknoledge 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().unwrap();

Usage & Documentation

Please see the documentation for current examples.

Commandline tool

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

Platform support

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

About

☝️Send Desktop Notifications on linux and bsd

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Rust 100.0%