dbus-notification


Namedbus-notification JSON
Version 2024.7.2 PyPI version JSON
download
home_pageNone
SummarySends notifications using DBus
upload_time2024-07-28 10:56:21
maintainerNone
docs_urlNone
authorNone
requires_python>=3.7.0
licenseNone
keywords lnxlink
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # DBus Notification

[![PyPI](https://img.shields.io/pypi/v/dbus-notification.svg)](https://pypi.python.org/pypi/dbus-notification)
![Python versions](https://img.shields.io/pypi/pyversions/dbus-notification.svg)
![License](https://img.shields.io/pypi/l/dbus-notification.svg)


This library provides a simple interface for creating and displaying desktop notifications with custom buttons. Please note that some features might have varying levels of support across different Linux distributions.


## Features:

 * Send notifications with custom titles, messages, and images
 * Include clickable buttons for user interaction
 * Control notification urgency, timeout, and sound
**Note:** Some features might have limited support depending on your desktop environment.


## Requirements

DBus Notification has minimal system dependencies:
* Python 3.7 or later
* `dasdbus` library

## Installation

Install the library using pip:

```bash
pip install dbus-notification
```

## Usage

This library offers two primary usage approaches:

### Command-Line Interaction

If you prefer a quick way to view information or control playback, you can potentially execute the dbus-notification script directly, though this doesn't support button actions. For more extensive programmatic control, I would recommend using the library within your Python code.

### Programmatic Control

Import the DBusNotification class from your Python code:

```python
import time
from dbus_notification import DBusNotification

def callback(notification_type, notification):
    if notification_type == "closed":
        print(f"Notification {notification["id"]} has closed.")
    elif notification_type == "button":
        print(f"Notification {notification["id"]} has clicked on the button {notification["button"]}.")

DBusNotification(appname="dbus_notification", callback=callback).send(
    title="test",
    message="this is a test message",
    logo="logo.png",
    image="myimage.png",
    sound="message-new-instant",
    actions=["Test Button"],
    urgency=1,
    timeout=100,
)

# Keep the app running
while True:
    time.sleep(1)
```

## Future Features

 * Support for notification categories
 * Resident or transient notification options
 * Ability to specify notification position on the screen

            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "dbus-notification",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.7.0",
    "maintainer_email": null,
    "keywords": "lnxlink",
    "author": null,
    "author_email": "bkbilly <bkbilly@hotmail.com>",
    "download_url": "https://files.pythonhosted.org/packages/6f/e4/e32cf99eead0d9edae62580928f5e35c4e2bcbd0bfcb805a4158e015b15d/dbus_notification-2024.7.2.tar.gz",
    "platform": null,
    "description": "# DBus Notification\n\n[![PyPI](https://img.shields.io/pypi/v/dbus-notification.svg)](https://pypi.python.org/pypi/dbus-notification)\n![Python versions](https://img.shields.io/pypi/pyversions/dbus-notification.svg)\n![License](https://img.shields.io/pypi/l/dbus-notification.svg)\n\n\nThis library provides a simple interface for creating and displaying desktop notifications with custom buttons. Please note that some features might have varying levels of support across different Linux distributions.\n\n\n## Features:\n\n * Send notifications with custom titles, messages, and images\n * Include clickable buttons for user interaction\n * Control notification urgency, timeout, and sound\n**Note:** Some features might have limited support depending on your desktop environment.\n\n\n## Requirements\n\nDBus Notification has minimal system dependencies:\n* Python 3.7 or later\n* `dasdbus` library\n\n## Installation\n\nInstall the library using pip:\n\n```bash\npip install dbus-notification\n```\n\n## Usage\n\nThis library offers two primary usage approaches:\n\n### Command-Line Interaction\n\nIf you prefer a quick way to view information or control playback, you can potentially execute the dbus-notification script directly, though this doesn't support button actions. For more extensive programmatic control, I would recommend using the library within your Python code.\n\n### Programmatic Control\n\nImport the DBusNotification class from your Python code:\n\n```python\nimport time\nfrom dbus_notification import DBusNotification\n\ndef callback(notification_type, notification):\n    if notification_type == \"closed\":\n        print(f\"Notification {notification[\"id\"]} has closed.\")\n    elif notification_type == \"button\":\n        print(f\"Notification {notification[\"id\"]} has clicked on the button {notification[\"button\"]}.\")\n\nDBusNotification(appname=\"dbus_notification\", callback=callback).send(\n    title=\"test\",\n    message=\"this is a test message\",\n    logo=\"logo.png\",\n    image=\"myimage.png\",\n    sound=\"message-new-instant\",\n    actions=[\"Test Button\"],\n    urgency=1,\n    timeout=100,\n)\n\n# Keep the app running\nwhile True:\n    time.sleep(1)\n```\n\n## Future Features\n\n * Support for notification categories\n * Resident or transient notification options\n * Ability to specify notification position on the screen\n",
    "bugtrack_url": null,
    "license": null,
    "summary": "Sends notifications using DBus",
    "version": "2024.7.2",
    "project_urls": {
        "Source Code": "https://github.com/bkbilly/dbus_notification"
    },
    "split_keywords": [
        "lnxlink"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "db457cc6153d10e1c3dc519afc14f25eda1b4f642ee226e6ad85059e3f55ce47",
                "md5": "2fc1fef8ba27ea5adffc65e5c9f107bc",
                "sha256": "0111043f00b660970f54ddea7bcdd560c0e21462e7cf89fbfeb9a30baec07513"
            },
            "downloads": -1,
            "filename": "dbus_notification-2024.7.2-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "2fc1fef8ba27ea5adffc65e5c9f107bc",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.7.0",
            "size": 5185,
            "upload_time": "2024-07-28T10:56:20",
            "upload_time_iso_8601": "2024-07-28T10:56:20.099966Z",
            "url": "https://files.pythonhosted.org/packages/db/45/7cc6153d10e1c3dc519afc14f25eda1b4f642ee226e6ad85059e3f55ce47/dbus_notification-2024.7.2-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "6fe4e32cf99eead0d9edae62580928f5e35c4e2bcbd0bfcb805a4158e015b15d",
                "md5": "56474f2d4d80eb124b150a4f7611ab05",
                "sha256": "083f2ea855e224743761936117dc66070a084e2163685136d9f56ec21f32a721"
            },
            "downloads": -1,
            "filename": "dbus_notification-2024.7.2.tar.gz",
            "has_sig": false,
            "md5_digest": "56474f2d4d80eb124b150a4f7611ab05",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.7.0",
            "size": 4412,
            "upload_time": "2024-07-28T10:56:21",
            "upload_time_iso_8601": "2024-07-28T10:56:21.329668Z",
            "url": "https://files.pythonhosted.org/packages/6f/e4/e32cf99eead0d9edae62580928f5e35c4e2bcbd0bfcb805a4158e015b15d/dbus_notification-2024.7.2.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-07-28 10:56:21",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "bkbilly",
    "github_project": "dbus_notification",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "lcname": "dbus-notification"
}
        
Elapsed time: 0.98292s