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:
app_name (str) – The name of the app. If it matches the application name in an existing desktop entry, the icon from that entry will be used by default.
app_icon – The default icon to use for notifications. Will take precedence over any icon from the desktop file. Should be a URI or a name in a freedesktop.org-compliant icon theme.
notification_limit (int | None) – Maximum number of notifications to keep in the system’s notification center.
- 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:
- 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