Skip to content

Commit c71418a

Browse files
authored
Merge pull request #137 from amiltonjr/feature/hide-python-launcher-icon-from-macos-dock
Hide Python Launcher icon from MacOS dock
2 parents 5be55f7 + b6fcdb8 commit c71418a

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

main.py

+7
Original file line numberDiff line numberDiff line change
@@ -151,5 +151,12 @@ def on_exit_tray(tray_icon, item):
151151
scheduler.QueueHandler()
152152

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

0 commit comments

Comments
 (0)