diff --git a/FileStorage/kitty-nautilus.py b/FileStorage/kitty-nautilus.py deleted file mode 100644 index 08121e9..0000000 --- a/FileStorage/kitty-nautilus.py +++ /dev/null @@ -1,43 +0,0 @@ -#!/usr/bin/env python3 -# FROM https://github.com/Dragnansia/Kitty-Nautilus -from gi import require_version -require_version('Gtk', '3.0') -require_version('Nautilus', '3.0') - -from gi.repository import Nautilus, GObject -import os, subprocess - -PROCESSNAME = 'kitty' - -class KittyExtension(Nautilus.MenuProvider, GObject.GObject): - def __init__(self): - pass - - def launch_kitty(self, menu: Nautilus.MenuItem, files): - path = '.' - args = '--working-directory' - - for file in files: - dirpath = file.get_location().get_path() - if os.path.isdir(dirpath) and os.path.exists(dirpath): - path = dirpath - - subprocess.Popen([PROCESSNAME, args, path], shell=False) - - def get_file_items(self, window, files): - item = Nautilus.MenuItem( - name="KittyOpen", - label="Ouvrir dans kitty", - tip="Ouvre le dossier sélectionné dans kitty" - ) - item.connect('activate', self.launch_kitty, files) - return [item] - - def get_background_items(self, window, file_): - item = Nautilus.MenuItem( - name="KittyOpenBackGround", - label="Ouvrir dans Kitty", - tip="Ouvre le dossier courant dans kitty" - ) - item.connect('activate', self.launch_kitty, [file_]) - return [item]