This repository has been archived on 2024-12-01. You can view files and clone it, but cannot push or open issues or pull requests.
PyBitmessage-2024-12-01/src/plugins/notification_notify2.py
Peter Surda 89567cecfa
Notifier plugin fix
- NotifyOSD doesn't like too many notification objects in a queue, so
just create one on init and update its contents if there is a new
notification
2017-11-14 23:19:16 +01:00

16 lines
459 B
Python

# -*- coding: utf-8 -*-
import gi
gi.require_version('Notify', '0.7')
from gi.repository import Notify
Notify.init('pybitmessage')
def connect_plugin(title, subtitle, category, label, icon):
if not icon:
icon = 'mail-message-new' if category == 2 else 'pybitmessage'
connect_plugin.notification.update(title, subtitle, icon)
connect_plugin.notification.show.show()
connect_plugin.notification = Notify.Notification.new("Init", "Init")