From ef1db6d089530ceb6928e78398932df15c3f9403 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Tue, 22 Sep 2020 16:32:40 +0530 Subject: [PATCH] macOS: Add some keys to Info.plist to allow programs running inside kitty to access protected Cocoa APIs. --- setup.py | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/setup.py b/setup.py index eccefc867..8a75b30de 100755 --- a/setup.py +++ b/setup.py @@ -866,6 +866,10 @@ Categories=System;TerminalEmulator; def macos_info_plist() -> bytes: import plistlib VERSION = '.'.join(map(str, version)) + + def access(what: str, verb: str = 'would like to access') -> str: + return f'A program running inside kitty {verb} {what}' + pl = dict( # see https://github.com/kovidgoyal/kitty/issues/1233 CFBundleDevelopmentRegion='English', @@ -906,6 +910,16 @@ def macos_info_plist() -> bytes: 'NSSendTypes': ['NSFilenamesPboardType', 'public.plain-text'], }, ], + NSAppleEventsUsageDescription=access('AppleScript.'), + NSCalendarsUsageDescription=access('your calendar data.'), + NSCameraUsageDescription=access('the camera.'), + NSContactsUsageDescription=access('your contacts.'), + NSLocationAlwaysUsageDescription=access('your location information, even in the background.'), + NSLocationUsageDescription=access('your location information.'), + NSLocationWhenInUseUsageDescription=access('your location while active.'), + NSMicrophoneUsageDescription=access('your microphone.'), + NSRemindersUsageDescription=access('your reminders.'), + NSSystemAdministrationUsageDescription=access('elevated privileges.', 'requires'), ) return plistlib.dumps(pl)