From 9ca691c0c6ded1033c549acc09443128e9e7ad5f Mon Sep 17 00:00:00 2001 From: pagedown Date: Fri, 7 Jan 2022 18:00:33 +0800 Subject: [PATCH] macOS: Add kitty to the open with list for text files and image files --- setup.py | 24 +++++++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) diff --git a/setup.py b/setup.py index 8fc8bdc78..0e42f9f0f 100755 --- a/setup.py +++ b/setup.py @@ -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(