desktop_notifier.dbus
¶
Notification backend for Linux. Includes an implementation to send desktop notifications over Dbus. Responding to user interaction with a notification requires a running asyncio event loop.
Module Contents¶
Classes¶
DBus notification backend for Linux |
- class desktop_notifier.dbus.DBusDesktopNotifier(app_name='Python', notification_limit=None)[source]¶
Bases:
desktop_notifier.base.DesktopNotifierBase
DBus notification backend for Linux
This implements the org.freedesktop.Notifications standard. The DBUS connection is created in a thread with a running asyncio loop to handle clicked notifications.
- Parameters:
- async request_authorisation()[source]¶
Request authorisation to send notifications.
- Returns:
Whether authorisation has been granted.
- Return type:
- async has_authorisation()[source]¶
Whether we have authorisation to send notifications.
- Return type:
- async _send(notification, notification_to_replace)[source]¶
Asynchronously sends a notification via the Dbus interface.
- Parameters:
notification (desktop_notifier.base.Notification) – Notification to send.
notification_to_replace (desktop_notifier.base.Notification | None) – Notification to replace, if any.
- Return type:
None
- async _clear(notification)[source]¶
Asynchronously removes a notification from the notification center
- Parameters:
notification (desktop_notifier.base.Notification)
- Return type:
None
- async _clear_all()[source]¶
Asynchronously clears all notifications from notification center
- Return type:
None