Skip to main content

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


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.2.tar.gz (3.2 kB view details)

Uploaded Source

Built Distribution

pynotifyd-0.0.2-py3-none-any.whl (8.2 kB view details)

Uploaded Python 3

File details

Details for the file pynotifyd-0.0.2.tar.gz.

File metadata

  • Download URL: pynotifyd-0.0.2.tar.gz
  • Upload date:
  • Size: 3.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for pynotifyd-0.0.2.tar.gz
Algorithm Hash digest
SHA256 e949a1467220f355dc4da73f366eb22a5a36d76f26dfa02848a934087789913b
MD5 65c08468c85e881dba948114f0fdb921
BLAKE2b-256 8880fb0900883ac6f108b353caf12ac5fd7e570de2bc6e909065d7aa756bd8e8

See more details on using hashes here.

File details

Details for the file pynotifyd-0.0.2-py3-none-any.whl.

File metadata

File hashes

Hashes for pynotifyd-0.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 3e23f58a8e6802c779c215a85fd9492438ea51deaf3ebb643a8b9bdc349ed8a3
MD5 d319db1adc8b3acb60e6d9cbbfaeecc7
BLAKE2b-256 649f3d7033c207778a68e1bc308e951b0b4d9d4118431f5d8fa968bb1e6cdccb

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page