#linux-terminal #notifications #notify #warnings #systems #sending #info

linux_terminal_notify

A Rust library for sending terminal notifications on Linux systems

2 releases

new 0.1.1 Nov 21, 2024
0.1.0 Nov 2, 2024

#9 in #warnings

Download history 130/week @ 2024-10-31 13/week @ 2024-11-07

143 downloads per month

MIT license

4KB

Linux Terminal Notify

linux_terminal_notify is a lightweight Rust library for sending terminal notifications on Linux systems. It allows developers to easily send customizable notifications directly to the terminal, enhancing the user experience with real-time alerts.

Features

  • Simple API: Easy-to-use functions to send notifications.
  • Customizable Messages: Specify different types of notifications (info, warning, error).
  • Terminal Colors: Color-coded messages for better visibility.
  • Optional Sound Alerts: Support for sound notifications if the terminal supports it.

Installation

Add this to your Cargo.toml:

[dependencies]
linux_terminal_notify = "0.1.0"

Usage

Here’s a quick example to get you started:

extern crate linux_terminal_notify;

use linux_terminal_notify::{notify, NotificationType};

fn main() {
    notify("Build completed.", NotificationType::Info);
    notify("Disk space low.", NotificationType::Warning);
    notify("Build failed.", NotificationType::Error);
}

Examples

extern crate linux_terminal_notify;

use linux_terminal_notify::{notify, NotificationType};

fn main() {
    // Info notification
    notify("Deployment successful!", NotificationType::Info);
    
    // Warning notification
    notify("Memory usage is high.", NotificationType::Warning);

    // Error notification
    notify("Unable to connect to database.", NotificationType::Error);
}

License

This project is licensed under the MIT License. See the LICENSE file for details.

Author

bensatlantik

No runtime deps