willibrandon/znotify
Cross-platform desktop notifications CLI written in Zig with zero dependencies
A lightweight, cross-platform command-line utility for desktop notifications written in Zig.
In Development - Not yet ready for production use
Currently implemented:
Coming soon:
# Build the project
zig build
# Run tests
zig build test
# Run benchmarks
zig build bench
# Build release binary
zig build -Doptimize=ReleaseSafe
# Windows (x86_64)
zig build -Dtarget=x86_64-windows
# Linux (x86_64)
zig build -Dtarget=x86_64-linux-gnu
# macOS (x86_64)
zig build -Dtarget=x86_64-macos
# macOS (ARM64)
zig build -Dtarget=aarch64-macos
Test Linux D-Bus functionality on any platform:
# Build Docker image
./scripts/build-docker.sh # Linux/macOS
.\scripts\build-docker.ps1 # Windows
# Run tests
./scripts/test-linux.sh test # Linux/macOS
.\scripts\test-linux.ps1 test # Windows
See docker/README.md for details.
# Basic notification
znotify "Title" "Message"
# With urgency level
znotify "Warning" "Disk space low" -u critical
# With icon
znotify "Update Available" "Click to install" -i software-update
# Custom timeout
znotify "Auto-save" "Changes saved" -t 2000
# notify-send compatibility mode
znotify --compat -u low -i dialog-information "Info" "Operation complete"
CLI Layer (cli.zig)
↓
Core Engine (core.zig, notification.zig)
↓
Platform Abstraction Layer (platform/backend.zig)
↓
Platform Implementations
├── Windows: WinRT Toast API
├── Linux: D-Bus (org.freedesktop.Notifications)
└── macOS: UserNotifications framework
# Unit tests
zig build test
# Benchmarks
zig build bench
# Linux integration tests (Docker)
./scripts/test-linux.sh test # Linux/macOS
.\scripts\test-linux.ps1 test # Windows
MIT License - See LICENSE for details.