How to hide an application icon from a Mac OS X dock

I have a wxpython script that creates wx.App and a frame, hides it and does some processing using a hidden frame. I don't want this script icon to appear in the Mac dock, but it does come. Since I can hide it, I did not find anything in wxPython, so there is some kind of API there that I can name?

The simplest python script displays an icon

 >>> import wx >>> app = wx.App() 
+2
source share
2 answers

I could not find a way to hide the application icon programmatically, but there seems to be only one way to set LSUIElement=1 in Info.plist, so applications that need to turn the icon on and off depending on the user option may have two applications that use all code using symbolic links, with the exception of info.plist files, which will be different for different applications in mode.

In any case, this explains it better.

http://codesorcery.net/2008/02/06/feature-requests-versus-the-right-way-to-do-it

+2
source

Using this AppKit code before downloading the application:

 from AppKit import NSBundle bundle = NSBundle.mainBundle() info = bundle.localizedInfoDictionary() or bundle.infoDictionary() info['LSUIElement'] = '1' 
0
source

Source: https://habr.com/ru/post/1238000/


All Articles