unofficial mirror of guix-devel@gnu.org 
 help / color / mirror / code / Atom feed
blob 688544b41831fc6be9a57f5f3b5b447209d9a9b7 1498 bytes (raw)
name: packages/patches/gnome-settings-daemon-gc.patch 	 # note: path name is non-authoritative(*)

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
 
This patch adds a "guix gc" button to the low disk space notification
that 'gsd-housekeeping' emits.

diff --git a/plugins/housekeeping/gsd-disk-space.c b/plugins/housekeeping/gsd-disk-space.c
index bd3437e..89027d8 100644
--- a/plugins/housekeeping/gsd-disk-space.c
+++ b/plugins/housekeeping/gsd-disk-space.c
@@ -546,6 +546,21 @@ empty_trash_callback (NotifyNotification *n,
         notify_notification_close (n, NULL);
 }
 
+static void
+guix_gc_callback (NotifyNotification *n,
+                  const char         *action)
+{
+        const gchar *argv[] = { "guix", "gc", NULL };
+
+        g_assert (action != NULL);
+        g_assert (strcmp (action, "run-guix-gc") == 0);
+
+        g_spawn_async (NULL, (gchar **) argv, NULL, G_SPAWN_SEARCH_PATH,
+                       NULL, NULL, NULL, NULL);
+
+        notify_notification_close (n, NULL);
+}
+
 static void
 on_notification_closed (NotifyNotification *n)
 {
@@ -591,6 +606,13 @@ ldsm_notify (const char *summary,
                                                 g_free);
         }
 
+        notify_notification_add_action (notification,
+                                        "run-guix-gc",
+                                        _("Collect Unused Guix Items"),
+                                        (NotifyActionCallback) guix_gc_callback,
+                                        NULL,
+                                        NULL);
+
         has_trash = ldsm_mount_has_trash (mount_path);
 
         if (has_trash) {

debug log:

solving 688544b41831fc6be9a57f5f3b5b447209d9a9b7 ...
found 688544b41831fc6be9a57f5f3b5b447209d9a9b7 in https://git.savannah.gnu.org/cgit/guix.git

(*) Git path names are given by the tree(s) the blob belongs to.
    Blobs themselves have no identifier aside from the hash of its contents.^

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).