GNTP - Growl Notification Transport Protocol Client
A complete Rust implementation of the Growl Notification Transport Protocol (GNTP) for sending desktop notifications.
Features
- ✅ Full GNTP 1.0 protocol implementation
- ✅ Binary icon support (PNG, JPG, etc.)
- ✅ Multiple notification types per application
- ✅ Priority levels (-2 to 2)
- ✅ Sticky notifications
- ✅ Comprehensive error handling
- ✅ No external dependencies (except uuid)
- ✅ Cross-platform (Windows, macOS, Linux)
Installation
Add this to your Cargo.toml:
[]
= "0.1"
Requirements
You need a GNTP-compatible notification client:
- Windows: Growl for Windows
- macOS: Growl for Mac (legacy) or compatible client
- Linux: Snarl or compatible GNTP daemon
Default server: localhost:23053
Quick Start
use ;
Examples
Basic Notification
use ;
let mut client = new;
let notification = new;
client.register?;
client.notify?;
With Icon
use ;
let mut client = new;
// Load application icon
if let Ok = from_file
let notification = new;
client.register?;
client.notify?;
With Options (Priority & Sticky)
use ;
let mut client = new;
let notification = new;
client.register?;
let options = new
.with_sticky
.with_priority;
client.notify_with_options?;
Multiple Notification Types
let mut client = new;
let notifications = vec!;
client.register?;
client.notify?;
client.notify?;
client.notify?;
Protocol Details
GNTP requires two separate steps:
- REGISTER - Register your application and notification types (once at startup)
- NOTIFY - Send notifications (multiple times)
Icons are sent as binary resources with unique identifiers, not as file paths.
Error Handling
match client.register
Running Examples
# Basic example
# With icon
# Multiple notification types
# With options (priority, sticky)
# Error handling
License
Licensed under either of:
- Apache License, Version 2.0 (LICENSE-APACHE)
- MIT license (LICENSE-MIT)
at your option.
Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
