Also add openable mimetypes to kitty-open.desktop

This commit is contained in:
Kovid Goyal 2022-02-06 20:27:50 +05:30
parent 73b0312dcb
commit 01d866f482
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C
2 changed files with 6 additions and 4 deletions

View File

@ -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 <https://www.gnu.org/software/stow/>`_

View File

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