gnomeExtensions.system-monitor: patch to add GTop to the extension's path

This commit is contained in:
Nanotwerp 2024-05-08 11:26:57 -04:00 committed by Nano Twerpus
parent 1ff88d2f06
commit 064730b54f
2 changed files with 34 additions and 0 deletions

View File

@ -124,6 +124,15 @@ super: lib.trivial.pipe super [
];
}))
(patchExtension "system-monitor@gnome-shell-extensions.gcampax.github.com" (old: {
patches = [
(substituteAll {
src = ./extensionOverridesPatches/system-monitor_at_gnome-shell-extensions.gcampax.github.com.patch;
gtop_path = "${libgtop}/lib/girepository-1.0";
})
];
}))
(patchExtension "system-monitor-next@paradoxxx.zero.gmail.com" (old: {
patches = [
(substituteAll {

View File

@ -0,0 +1,25 @@
diff --git a/extension.js b/extension.js
index 37d2eb1..232d0d5 100644
--- a/extension.js
+++ b/extension.js
@@ -6,9 +6,9 @@
import Clutter from 'gi://Clutter';
import Gio from 'gi://Gio';
+import GIRepository from "gi://GIRepository";
import GLib from 'gi://GLib';
import GObject from 'gi://GObject';
-import GTop from 'gi://GTop';
import Pango from 'gi://Pango';
import Shell from 'gi://Shell';
import St from 'gi://St';
@@ -19,6 +19,9 @@ import * as PopupMenu from 'resource:///org/gnome/shell/ui/popupMenu.js';
import * as Main from 'resource:///org/gnome/shell/ui/main.js';
+GIRepository.Repository.prepend_search_path('@gtop_path@');
+const GTop = (await import("gi://GTop")).default;
+
const THRESHOLD_HIGH = 0.80;
// adapted from load-graph.cpp in gnome-system-monitor