aboutsummaryrefslogtreecommitdiff
path: root/gnu/packages/patches/gnome-settings-daemon-gc.patch
diff options
context:
space:
mode:
authorMaxim Cournoyer <maxim.cournoyer@gmail.com>2020-10-19 12:51:57 -0400
committerMaxim Cournoyer <maxim.cournoyer@gmail.com>2020-10-19 13:11:40 -0400
commit5e2140511c1ad9ccd731438b74d61b62111da1e6 (patch)
treea4ff748ad26e121b88469b5d921001ef1382be8f /gnu/packages/patches/gnome-settings-daemon-gc.patch
parent9e3a5ee417ea7fe9721be8804ff047e80c4f22ed (diff)
parent353bdae32f72b720c7ddd706576ccc40e2b43f95 (diff)
downloadguix-5e2140511c1ad9ccd731438b74d61b62111da1e6.tar.gz
guix-5e2140511c1ad9ccd731438b74d61b62111da1e6.zip
Merge branch 'staging'
Conflicts: gnu/packages/admin.scm gnu/packages/commencement.scm gnu/packages/gdb.scm gnu/packages/llvm.scm gnu/packages/package-management.scm gnu/packages/tls.scm
Diffstat (limited to 'gnu/packages/patches/gnome-settings-daemon-gc.patch')
-rw-r--r--gnu/packages/patches/gnome-settings-daemon-gc.patch43
1 files changed, 43 insertions, 0 deletions
diff --git a/gnu/packages/patches/gnome-settings-daemon-gc.patch b/gnu/packages/patches/gnome-settings-daemon-gc.patch
new file mode 100644
index 0000000000..688544b418
--- /dev/null
+++ b/gnu/packages/patches/gnome-settings-daemon-gc.patch
@@ -0,0 +1,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) {