From 672c2c9b58afdca76e7c6f5e0373bd41e3bd852b Mon Sep 17 00:00:00 2001 From: Bob Mottram Date: Wed, 10 Mar 2021 14:22:33 +0000 Subject: [PATCH] Option for desktop notification command type --- epicyon.py | 9 ++++++++- notifications_client.py | 2 +- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/epicyon.py b/epicyon.py index 5336a19fb..0b9ffe78f 100644 --- a/epicyon.py +++ b/epicyon.py @@ -109,6 +109,11 @@ parser.add_argument('--unfol', '--unfollow', dest='unfollow', type=str, parser.add_argument('-d', '--domain', dest='domain', type=str, default=None, help='Domain name of the server') +parser.add_argument('--notificationType', '--notifyType', + dest='notificationType', type=str, + default='notify-send', + help='Type of desktop notification command: ' + + 'notify-send/osascript/New-BurntToastNotification') parser.add_argument('-o', '--onion', dest='onion', type=str, default=None, help='Onion domain name of the server if ' + @@ -1935,7 +1940,9 @@ if args.notifications: runNotificationsClient(baseDir, proxyType, httpPrefix, nickname, domain, port, args.password, args.screenreader, args.language, - args.notificationSounds, args.debug) + args.notificationSounds, + args.notificationType, + args.debug) sys.exit() if federationList: diff --git a/notifications_client.py b/notifications_client.py index 3f20561cc..43087c683 100644 --- a/notifications_client.py +++ b/notifications_client.py @@ -142,6 +142,7 @@ def runNotificationsClient(baseDir: str, proxyType: str, httpPrefix: str, password: str, screenreader: str, systemLanguage: str, notificationSounds: bool, + notificationType: str, debug: bool) -> None: """Runs the notifications and screen reader client, which announces new inbox items @@ -189,7 +190,6 @@ def runNotificationsClient(baseDir: str, proxyType: str, httpPrefix: str, likeSoundFilename = 'like.ogg' shareSoundFilename = 'share.ogg' player = 'ffplay' - notificationType = 'notify-send' nameStr = None gender = None messageStr = None