From 01d866f48298301a8e5f456e1e82fbd876afd7a0 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Sun, 6 Feb 2022 20:27:50 +0530 Subject: [PATCH] Also add openable mimetypes to kitty-open.desktop --- docs/binary.rst | 6 ++++-- setup.py | 4 ++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/docs/binary.rst b/docs/binary.rst index 21b55ac08..d1ad812d0 100644 --- a/docs/binary.rst +++ b/docs/binary.rst @@ -53,8 +53,10 @@ particular desktop, but it should work for most major desktop environments. ln -s ~/.local/kitty.app/bin/kitty ~/.local/bin/ # Place the kitty.desktop file somewhere it can be found by the OS cp ~/.local/kitty.app/share/applications/kitty.desktop ~/.local/share/applications/ - # Update the path to the kitty icon in the kitty.desktop file - sed -i "s|Icon=kitty|Icon=/home/$USER/.local/kitty.app/share/icons/hicolor/256x256/apps/kitty.png|g" ~/.local/share/applications/kitty.desktop + # If you want to open text files and images in kitty via your file manager also add the kitty-open.desktop file + cp ~/.local/kitty.app/share/applications/kitty-open.desktop ~/.local/share/applications/ + # Update the path to the kitty icon in the kitty.desktop file(s) + sed -i "s|Icon=kitty|Icon=/home/$USER/.local/kitty.app/share/icons/hicolor/256x256/apps/kitty.png|g" ~/.local/share/applications/kitty*.desktop .. note:: If you use the venerable `stow `_ diff --git a/setup.py b/setup.py index efd8378f5..688e77031 100755 --- a/setup.py +++ b/setup.py @@ -969,7 +969,7 @@ Icon=kitty Categories=System;TerminalEmulator; ''' ) - with open(os.path.join(deskdir, 'kitty-launcher.desktop'), 'w') as f: + with open(os.path.join(deskdir, 'kitty-open.desktop'), 'w') as f: f.write( '''\ [Desktop Entry] @@ -983,7 +983,7 @@ Exec=kitty +open %U Icon=kitty Categories=System;TerminalEmulator; NoDisplay=true -MimeType=x-scheme-handler/kitty; +MimeType=image/*;application/x-sh;inode/directory;text/*;x-scheme-handler/kitty; ''' )