Compare commits
2 Commits
b59136286e
...
main
| Author | SHA1 | Date | |
|---|---|---|---|
|
0d748e6706
|
|||
|
f8ed7b1c1f
|
@@ -25,3 +25,12 @@ additional information.
|
||||
|
||||
After installing or uninstalling, you must quit and restart nautilus for the
|
||||
change to take effect (`nautilus -q`).
|
||||
|
||||
## Development
|
||||
|
||||
Exit nautilus with `nautilus --quit` and run nautilus with additional debugging
|
||||
output with `nautilus --no-desktop`.
|
||||
|
||||
- [API Reference]
|
||||
|
||||
[API Reference]: https://gnome.pages.gitlab.gnome.org/nautilus-python/class-nautilus-python-menu-provider.html
|
||||
|
||||
@@ -34,12 +34,14 @@ class KittyNautilusExtension(GObject.GObject, Nautilus.MenuProvider):
|
||||
item.connect("activate", self.launch_kitty, path)
|
||||
return item
|
||||
|
||||
def get_file_items(self, _window, files) -> [Nautilus.MenuItem]:
|
||||
def get_file_items(self, *args) -> [Nautilus.MenuItem]:
|
||||
files = args[-1]
|
||||
if len(files) == 1:
|
||||
path = files[0].get_location().get_path()
|
||||
if os.path.isdir(path):
|
||||
return [self.make_item("NautilusFileOpenKitty", path)]
|
||||
|
||||
def get_background_items(self, _window, file) -> [Nautilus.MenuItem]:
|
||||
path = file.get_location().get_path()
|
||||
def get_background_items(self, *args) -> [Nautilus.MenuItem]:
|
||||
folder = args[-1]
|
||||
path = folder.get_location().get_path()
|
||||
return [self.make_item("NautilusBackgroundOpenKitty", path)]
|
||||
|
||||
Reference in New Issue
Block a user