1
0
Fork 1
mirror of https://github.com/NixOS/nixpkgs.git synced 2024-11-18 03:30:45 +00:00

Merge pull request #315470 from NixOS/backport-310143-to-release-24.05

[Backport release-24.05] `gnomeExtensions.system-monitor`: patch to add `GTop` to the extension's path
This commit is contained in:
Basti 2024-06-08 19:26:55 +00:00 committed by GitHub
commit 489f4bc518
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 34 additions and 0 deletions

View file

@ -114,6 +114,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