macOS: Add kitty to the open with list for text files and image files

This commit is contained in:
pagedown 2022-01-07 18:00:33 +08:00
parent bf84f95a94
commit 9ca691c0c6
No known key found for this signature in database
GPG Key ID: E921CF18AC8FF6EB

View File

@ -999,13 +999,35 @@ def macos_info_plist() -> bytes:
},
{
'CFBundleTypeName': 'Folders',
'CFBundleTypeOSTypes': ['fold'],
'LSItemContentTypes': ['public.directory'],
'CFBundleTypeRole': 'Editor',
'LSHandlerRank': 'Alternate',
},
{
'LSItemContentTypes': ['public.unix-executable'],
'CFBundleTypeRole': 'Shell',
},
{
'CFBundleTypeName': 'Text files',
'LSItemContentTypes': ['public.text'],
'LSTypeIsPackage': False,
'CFBundleTypeRole': 'Editor',
'LSHandlerRank': 'Alternate',
},
{
'CFBundleTypeName': 'Image files',
'LSItemContentTypes': ['public.image'],
'LSTypeIsPackage': False,
'CFBundleTypeRole': 'Viewer',
'LSHandlerRank': 'Alternate',
},
# Allows dragging arbitrary files to kitty, but does not include kitty in the open with list.
{
'CFBundleTypeName': 'All files',
'LSItemContentTypes': ['public.content', 'public.data'],
'CFBundleTypeRole': 'None',
'LSHandlerRank': 'None',
},
]
pl = dict(