macOS: Add some keys to Info.plist to allow programs running inside kitty to access protected Cocoa APIs.

This commit is contained in:
Kovid Goyal 2020-09-22 16:32:40 +05:30
parent 9d4246a285
commit ef1db6d089
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C

View File

@ -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)