2017-03-10 00:00:54 +01:00
|
|
|
# -*- coding: utf-8 -*-
|
2019-09-23 12:38:00 +02:00
|
|
|
"""
|
2019-12-21 08:14:33 +01:00
|
|
|
Notification plugin using notify2
|
2019-09-23 12:38:00 +02:00
|
|
|
"""
|
2017-03-10 00:00:54 +01:00
|
|
|
|
|
|
|
import gi
|
|
|
|
gi.require_version('Notify', '0.7')
|
|
|
|
from gi.repository import Notify
|
|
|
|
|
|
|
|
Notify.init('pybitmessage')
|
|
|
|
|
2019-09-23 12:38:00 +02:00
|
|
|
|
2019-12-21 08:14:33 +01:00
|
|
|
def connect_plugin(title, subtitle, category, _, icon):
|
2019-09-23 12:38:00 +02:00
|
|
|
"""Plugin for notify2"""
|
2017-03-10 00:00:54 +01:00
|
|
|
if not icon:
|
|
|
|
icon = 'mail-message-new' if category == 2 else 'pybitmessage'
|
2017-11-14 23:19:16 +01:00
|
|
|
connect_plugin.notification.update(title, subtitle, icon)
|
2017-11-14 23:46:07 +01:00
|
|
|
connect_plugin.notification.show()
|
2017-11-14 23:19:16 +01:00
|
|
|
|
2019-09-23 12:38:00 +02:00
|
|
|
|
2017-11-14 23:19:16 +01:00
|
|
|
connect_plugin.notification = Notify.Notification.new("Init", "Init")
|