Simple notification server
Project description
pynotifyd
Simple freedesktop notification daemon.
Installation
pip install pynotifyd
Usage
pynotifyd
outputs JSON-formatted notification events at the standard output
and debug information at stderr
. Each notification is on exactly one line to
make it easier to be collected by shell scripts.
Event types:
notify
- Notification has been emitted
{
"action": "notify",
"notification": {
"id": 3,
"app_name": "KDE Connect",
"app_icon": "kdeconnect",
"summary": "WhatsApp",
"body": "Tudor: Hi!",
"urgency": 2
}
}
delete
- Notification has been dismissed or expired
{
"action": "delete",
"id": 1
}
Example usage
Requires jq.
#!/bin/sh
pynotifyd 2>/dev/null | while read -r line; do
action="$(echo "$line" | jq -r .action)"
case "$action" in
notify)
app_name="$(echo "$line" | jq -r .notification.app_name)"
echo "New notification from $app_name!"
;;
esac
done
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
pynotifyd-0.0.1.tar.gz
(3.1 kB
view hashes)
Built Distribution
Close
Hashes for pynotifyd-0.0.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | cb2e1a5bdb6a95455d352a457f2743f47a0a8193576a7eaacd9e184f4e7526f2 |
|
MD5 | 699dd0a0b2285679fb01ef059b055551 |
|
BLAKE2b-256 | 4c9f79699fecd5f7b879c266849b37360be6a03c4c7cfef32515285922610a8b |