Option for desktop notification command type

main
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,
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:

View File

@ -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