about summary refs log tree commit diff
path: root/pkgs/tools/networking/persepolis/0002-Fix-startup-crash-on-darwin.patch
blob: 50252c8cd72a8067eec4fb352d81016cc5d02a65 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
---
 persepolis/scripts/mac_notification.py | 25 +++++++++----------------
 1 file changed, 9 insertions(+), 16 deletions(-)

diff --git a/persepolis/scripts/mac_notification.py b/persepolis/scripts/mac_notification.py
index 4d69929..9a9a7cf 100644
--- a/persepolis/scripts/mac_notification.py
+++ b/persepolis/scripts/mac_notification.py
@@ -15,20 +15,13 @@
 
 # native notification on mac! needs Xcode (latest version) installed and pyobjc
 # library from pip
-import Foundation
-import AppKit
-import objc
-
-NSUserNotification = objc.lookUpClass('NSUserNotification')
-NSUserNotificationCenter = objc.lookUpClass('NSUserNotificationCenter')
-
-
 def notifyMac(title, subtitle, info_text, delay=0):
-    notification = NSUserNotification.alloc().init()
-    notification.setTitle_(title)
-    notification.setSubtitle_(subtitle)
-    notification.setInformativeText_(info_text)
-    notification.setDeliveryDate_(Foundation.NSDate.dateWithTimeInterval_sinceDate_(
-        delay, Foundation.NSDate.date()))
-    NSUserNotificationCenter.defaultUserNotificationCenter(
-    ).scheduleNotification_(notification)
+    print(f"""
+Warning: Persepolis was installed from nixpkgs, which currently breaks notifications
+         on macOS. Until https://github.com/NixOS/nixpkgs/issues/105156 is resolved,
+         this cannot be fixed. The notification that should've been displayed was:
+
+         title: {title}
+         subtitle: {subtitle}
+         info_text: {info_text}
+ """)
-- 
2.39.3 (Apple Git-145)