tapmap.autostart.macos_login_launch
tapmap.autostart.macos_login_launch
Detect macOS login-item launches from the kAEOpenApplication event.
The keyAELaunchedAsLogInItem ('lgit') value distinguishes login-item launches from manual launches.
logger = logging.getLogger(__name__)
module-attribute
_K_CORE_EVENT_CLASS = 1634039412
module-attribute
_K_AE_OPEN_APPLICATION = 1868656752
module-attribute
_KEY_AE_PROP_DATA = 1886545012
module-attribute
_KEY_AE_LAUNCHED_AS_LOGIN_ITEM = 1818716532
module-attribute
_delegate = None
module-attribute
_LoginLaunchDelegate
Bases: NSObject
Report the macOS login-launch decision once.
Source code in src/tapmap/autostart/macos_login_launch.py
29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 | |
initWithCallback_(callback)
Store the launch-decision callback.
Source code in src/tapmap/autostart/macos_login_launch.py
32 33 34 35 36 37 38 39 | |
applicationWillFinishLaunching_(notification)
Register the kAEOpenApplication handler before AppKit's default handling.
Source code in src/tapmap/autostart/macos_login_launch.py
41 42 43 44 45 46 47 48 | |
handleAppleEvent_withReplyEvent_(event, reply)
Report whether the launch event marks a login-item launch.
Source code in src/tapmap/autostart/macos_login_launch.py
50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 | |
install(on_decision)
Install login-launch detection before NSApplication.run() starts.
Call on_decision once on the main thread with the detected launch type.
Source code in src/tapmap/autostart/macos_login_launch.py
67 68 69 70 71 72 73 74 75 | |