diff options
Diffstat (limited to 'modules/responses/libnotify.py')
-rw-r--r-- | modules/responses/libnotify.py | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/modules/responses/libnotify.py b/modules/responses/libnotify.py index 2e83101..237b9ac 100644 --- a/modules/responses/libnotify.py +++ b/modules/responses/libnotify.py @@ -1,4 +1,15 @@ import os -def respond(text: str) -> None: - os.popen(f'notify-send Hestia "{text}" --app-name=hestia')
\ No newline at end of file +from .response_handler import ResponseHandler +from ..config import Config + + +class LibNotify(ResponseHandler): + def __init__(self, config: Config): + self.config = config + self.hestia_images = {} + for path in os.listdir(self.config.hestia_images): + self.hestia_images[os.path.splitext(os.path.basename(path))[0]] = os.path.join(self.config.hestia_images, path) + + def respond(self, text: str) -> None: + os.popen(f'notify-send Hestia "{text}" -i "{self.hestia_images["hestia"]}" --app-name=hestia')
\ No newline at end of file |