mirror of https://gitgud.io/fatchan/globalafk
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
18 lines
514 B
18 lines
514 B
import subprocess
|
|
from abc import ABC, abstractmethod
|
|
|
|
|
|
class Notifier(ABC):
|
|
@abstractmethod
|
|
def notify(self, title, content, *args, **kwargs):
|
|
raise NotImplementedError
|
|
|
|
|
|
class TermuxNotifier(Notifier):
|
|
def notify(self, title, content, *args, **kwargs):
|
|
subprocess.call(['termux-notification', '--title', title, '--content', content])
|
|
|
|
|
|
class NotifySendNotifier(Notifier):
|
|
def notify(self, title, content, *args, **kwargs):
|
|
subprocess.call(['notify-send', title, content])
|
|
|