How to hide application icon from Mac OS X dock

一个人想着一个人 提交于 2019-12-05 16:26:29

I was not able to find a way to hide app icon programmatically, only way seems to be to set LSUIElement=1 in Info.plist, so the apps which need to switch on and off icon depending on user option may have to have two app which share all the code using symbolic links except the info.plist files which will be different for different mode app.

Anyway this explains it better

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

Using this AppKit code before load your app:

from AppKit import NSBundle
bundle = NSBundle.mainBundle()
info = bundle.localizedInfoDictionary() or bundle.infoDictionary()
info['LSUIElement'] = '1'
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!