Skip to content

Commit

Permalink
Port notify plugin
Browse files Browse the repository at this point in the history
  • Loading branch information
heddxh committed Apr 27, 2024
1 parent 60bd132 commit ccac5c5
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 8 deletions.
2 changes: 1 addition & 1 deletion yin_yang/plugins/_plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,7 @@ class DBusPlugin(Plugin):
def __init__(self, message_data: List[str]):
super().__init__()
self.connection = QDBusConnection.sessionBus()
self.message = QDBusMessage()
self.message: QDBusMessage
self.message_data: List[str] = message_data # Store DBusMessage data(destination, path, interface, method)

def set_theme(self, theme: str):
Expand Down
12 changes: 5 additions & 7 deletions yin_yang/plugins/notify.py
Original file line number Diff line number Diff line change
@@ -1,14 +1,12 @@
from PySide6.QtDBus import QDBusMessage

from ..NotificationHandler import create_dbus_message
from ._plugin import DBusPlugin


class Notification(DBusPlugin):
def __init__(self):
super().__init__()
self.theme_light = 'Day'
self.theme_dark = 'Night'
super().__init__([]) # We do everything in [create_dbus_message]
self.theme_light = "Day"
self.theme_dark = "Night"

def create_message(self, theme: str) -> QDBusMessage:
return create_dbus_message('Theme changed', f'Set the theme to {theme}')
def create_message(self, theme: str):
self.message = create_dbus_message("Theme changed", f"Set the theme to {theme}")

0 comments on commit ccac5c5

Please sign in to comment.