This repository has been archived on 2025-03-02. You can view files and clone it, but cannot push or open issues or pull requests.
PyBitmessage-2025-03-02/src/plugins/notification_notify2.py

22 lines
523 B
Python
Raw Normal View History

# -*- coding: utf-8 -*-
2019-09-23 16:08:00 +05:30
"""
2019-12-21 12:44:33 +05:30
Notification plugin using notify2
2019-09-23 16:08:00 +05:30
"""
import gi
gi.require_version('Notify', '0.7')
from gi.repository import Notify
Notify.init('pybitmessage')
2019-09-23 16:08:00 +05:30
2019-12-21 12:44:33 +05:30
def connect_plugin(title, subtitle, category, _, icon):
2019-09-23 16:08:00 +05:30
"""Plugin for notify2"""
if not icon:
icon = 'mail-message-new' if category == 2 else 'pybitmessage'
connect_plugin.notification.update(title, subtitle, icon)
connect_plugin.notification.show()
2019-09-23 16:08:00 +05:30
connect_plugin.notification = Notify.Notification.new("Init", "Init")