Option for desktop notification command type

merge-requests/30/head
Bob Mottram 2021-03-10 14:22:33 +00:00
parent 8ccf785ada
commit 672c2c9b58
2 changed files with 9 additions and 2 deletions

View File

@ -109,6 +109,11 @@ parser.add_argument('--unfol', '--unfollow', dest='unfollow', type=str,
parser.add_argument('-d', '--domain', dest='domain', type=str, parser.add_argument('-d', '--domain', dest='domain', type=str,
default=None, default=None,
help='Domain name of the server') 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, parser.add_argument('-o', '--onion', dest='onion', type=str,
default=None, default=None,
help='Onion domain name of the server if ' + help='Onion domain name of the server if ' +
@ -1935,7 +1940,9 @@ if args.notifications:
runNotificationsClient(baseDir, proxyType, httpPrefix, runNotificationsClient(baseDir, proxyType, httpPrefix,
nickname, domain, port, args.password, nickname, domain, port, args.password,
args.screenreader, args.language, args.screenreader, args.language,
args.notificationSounds, args.debug) args.notificationSounds,
args.notificationType,
args.debug)
sys.exit() sys.exit()
if federationList: if federationList:

View File

@ -142,6 +142,7 @@ def runNotificationsClient(baseDir: str, proxyType: str, httpPrefix: str,
password: str, screenreader: str, password: str, screenreader: str,
systemLanguage: str, systemLanguage: str,
notificationSounds: bool, notificationSounds: bool,
notificationType: str,
debug: bool) -> None: debug: bool) -> None:
"""Runs the notifications and screen reader client, """Runs the notifications and screen reader client,
which announces new inbox items which announces new inbox items
@ -189,7 +190,6 @@ def runNotificationsClient(baseDir: str, proxyType: str, httpPrefix: str,
likeSoundFilename = 'like.ogg' likeSoundFilename = 'like.ogg'
shareSoundFilename = 'share.ogg' shareSoundFilename = 'share.ogg'
player = 'ffplay' player = 'ffplay'
notificationType = 'notify-send'
nameStr = None nameStr = None
gender = None gender = None
messageStr = None messageStr = None