nautilus-open-any-terminal: init at 0.2.15

This commit is contained in:
Felix Buehler 2021-03-21 22:59:00 +01:00
parent c1d884944e
commit 4b259a5334
3 changed files with 98 additions and 0 deletions

View File

@ -0,0 +1,64 @@
{ lib
, pkg-config
, dbus
, dconf
, fetchFromGitHub
, glib
, gnome
, gobject-introspection
, gsettings-desktop-schemas
, gtk3
, python3
, substituteAll
, wrapGAppsHook
}:
python3.pkgs.buildPythonPackage rec {
pname = "nautilus-open-any-terminal";
version = "0.2.15";
src = fetchFromGitHub {
owner = "Stunkymonkey";
repo = pname;
rev = version;
sha256 = "sha256-cc6Lh5XeAuU5Os4eJ0QcL6XJYB6DqxeUGaOf6m1OnpY=";
};
patches = [ ./hardcode-gsettings.patch ];
nativeBuildInputs = [
glib
pkg-config
wrapGAppsHook
];
buildInputs = [
dbus
dconf
gnome.nautilus
gnome.nautilus-python
gobject-introspection
gsettings-desktop-schemas
gtk3
python3.pkgs.pygobject3
];
postPatch = ''
substituteInPlace nautilus_open_any_terminal/open_any_terminal_extension.py \
--subst-var-by gsettings_path ${glib.makeSchemaPath "$out" "$name"}
'';
postInstall = ''
glib-compile-schemas "$out/share/glib-2.0/schemas"
'';
PKG_CONFIG_LIBNAUTILUS_EXTENSION_EXTENSIONDIR = "${placeholder "out"}/lib/nautilus/extensions-3.0";
meta = with lib; {
description = "Extension for nautilus, which adds an context-entry for opening other terminal-emulators then `gnome-terminal`";
license = licenses.gpl3Plus;
maintainers = with maintainers; [ stunkymonkey ];
homepage = "https://github.com/Stunkymonkey/nautilus-open-any-terminal";
platforms = platforms.linux;
};
}

View File

@ -0,0 +1,32 @@
diff --git a/nautilus_open_any_terminal/open_any_terminal_extension.py b/nautilus_open_any_terminal/open_any_terminal_extension.py
index b02a995..a616399 100644
--- a/nautilus_open_any_terminal/open_any_terminal_extension.py
+++ b/nautilus_open_any_terminal/open_any_terminal_extension.py
@@ -125,9 +125,10 @@ def set_terminal_args(*args):
class OpenAnyTerminalShortcutProvider(GObject.GObject, Nautilus.LocationWidgetProvider):
def __init__(self):
- source = Gio.SettingsSchemaSource.get_default()
- if source.lookup(GSETTINGS_PATH, True):
- self._gsettings = Gio.Settings.new(GSETTINGS_PATH)
+ source = Gio.SettingsSchemaSource.new_from_directory("@gsettings_path@", Gio.SettingsSchemaSource.get_default(), True)
+ if True:
+ _schema = source.lookup(GSETTINGS_PATH, False)
+ self._gsettings = Gio.Settings.new_full(_schema, None, None);
self._gsettings.connect("changed", self._bind_shortcut)
self._create_accel_group()
self._window = None
@@ -232,9 +233,10 @@ class OpenAnyTerminalExtension(GObject.GObject, Nautilus.MenuProvider):
return items
-source = Gio.SettingsSchemaSource.get_default()
-if source is not None and source.lookup(GSETTINGS_PATH, True):
- _gsettings = Gio.Settings.new(GSETTINGS_PATH)
+source = Gio.SettingsSchemaSource.new_from_directory("@gsettings_path@", Gio.SettingsSchemaSource.get_default(), True)
+if True:
+ _schema = source.lookup(GSETTINGS_PATH, False)
+ _gsettings = Gio.Settings.new_full(_schema, None, None);
_gsettings.connect("changed", set_terminal_args)
value = _gsettings.get_string(GSETTINGS_TERMINAL)
if value in TERM_PARAMS:

View File

@ -3467,6 +3467,8 @@ with pkgs;
mrkd = with python3Packages; toPythonApplication mrkd;
nautilus-open-any-terminal = callPackage ../tools/misc/nautilus-open-any-terminal { };
n2n = callPackage ../tools/networking/n2n { };
nextdns = callPackage ../applications/networking/nextdns { };