Monorepo for Aesthetic.Computer aesthetic.computer
4
fork

Configure Feed

Select the types of activity you want to include in your feed.

slab-menubar: instantiate NSApplication before setting activation policy

NSApp wrapper is None until NSApplication.sharedApplication() has been
called, so calling NSApp.setActivationPolicy_ on a freshly-imported
process raised AttributeError and the launchd agent thrashed.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

+5 -2
+5 -2
slab/bin/slab-menubar.py
··· 13 13 from pathlib import Path 14 14 15 15 import rumps 16 - from AppKit import NSApp, NSApplicationActivationPolicyAccessory 16 + from AppKit import NSApplication, NSApplicationActivationPolicyAccessory 17 17 18 18 SLAB_HOME = Path(os.environ.get("SLAB_HOME", os.path.expanduser("~/.local/share/slab"))) 19 19 SLAB_BIN = Path(os.environ.get("SLAB_BIN", os.path.expanduser("~/.local/bin"))) ··· 148 148 if __name__ == "__main__": 149 149 app = SlabApp() 150 150 # Hide from Dock and Cmd-Tab — menu bar item only. 151 - NSApp.setActivationPolicy_(NSApplicationActivationPolicyAccessory) 151 + # sharedApplication() instantiates the singleton; NSApp wrapper is None until then. 152 + NSApplication.sharedApplication().setActivationPolicy_( 153 + NSApplicationActivationPolicyAccessory 154 + ) 152 155 app.run()