From 994ce1809efbe70170bd11cccd6603e61e295f78 Mon Sep 17 00:00:00 2001 From: knilch Date: Mon, 15 Jun 2020 14:50:03 +0200 Subject: [PATCH] add windows notifications using an ugly invocation of the dreaded powershell on an overly long line, --- worktime.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/worktime.py b/worktime.py index 1c42716..eccab80 100755 --- a/worktime.py +++ b/worktime.py @@ -141,7 +141,9 @@ def notify(title, text, subtitle = None): return if is_windows(): - # TODO: Windows notifications + os.system(""" + powershell -c "[reflection.assembly]::loadwithpartialname('System.Windows.Forms');[reflection.assembly]::loadwithpartialname('System.Drawing');$notify=new-object system.windows.forms.notifyicon;$notify.icon=[System.Drawing.SystemIcons]::Information;$notify.visible=$true;$notify.showballoontip(10,'{}','{}',[system.windows.forms.tooltipicon]::None)" + """.format(title, text)) return # MAC notifications