summaryrefslogtreecommitdiff
path: root/modules/responses/libnotify.py
blob: 237b9acfc5f130076c268de0547598a5c51ce871 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
import os

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')