Skip to content

Commit b6fcdb8

Browse files
committed
Hide Python Launcher icon from MacOS dock
1 parent 0ddd234 commit b6fcdb8

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

main.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -148,5 +148,12 @@ def on_exit_tray(tray_icon, item):
148148
scheduler.QueueHandler()
149149

150150
if tray_icon and platform.system() == "Darwin":
151+
from AppKit import NSBundle, NSApp, NSAutoreleasePool, NSApplicationActivationPolicyRegular, NSApplicationActivationPolicyProhibited
152+
153+
# Hide Python Launcher icon from MacOS dock
154+
info = NSBundle.mainBundle().infoDictionary()
155+
info["LSUIElement"] = "1"
156+
NSApp.setActivationPolicy_(NSApplicationActivationPolicyProhibited)
157+
151158
# For macOS: display the tray icon now with blocking function
152159
tray_icon.run()

0 commit comments

Comments
 (0)