[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
03/03: gnu: gnome-settings-daemon: Add "guix gc" to low disk space notif
From: |
guix-commits |
Subject: |
03/03: gnu: gnome-settings-daemon: Add "guix gc" to low disk space notification. |
Date: |
Fri, 18 Sep 2020 02:46:35 -0400 (EDT) |
civodul pushed a commit to branch master
in repository guix.
commit 98b89f432103b66efacee0bcba41a94148b8e870
Author: Ludovic Courtès <ludo@gnu.org>
AuthorDate: Fri Sep 18 00:04:49 2020 +0200
gnu: gnome-settings-daemon: Add "guix gc" to low disk space notification.
* gnu/packages/patches/gnome-settings-daemon-gc.patch: New file.
* gnu/local.mk (dist_patch_DATA): Add it.
* gnu/packages/gnome.scm (gnome-settings-daemon)[source]: Use it.
---
gnu/local.mk | 1 +
gnu/packages/gnome.scm | 3 +-
.../patches/gnome-settings-daemon-gc.patch | 43 ++++++++++++++++++++++
3 files changed, 46 insertions(+), 1 deletion(-)
diff --git a/gnu/local.mk b/gnu/local.mk
index 6cdbe0d..1a1a648 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -1068,6 +1068,7 @@ dist_patch_DATA =
\
%D%/packages/patches/gmp-faulty-test.patch \
%D%/packages/patches/gnome-shell-theme.patch \
%D%/packages/patches/gnome-shell-disable-test.patch \
+ %D%/packages/patches/gnome-settings-daemon-gc.patch \
%D%/packages/patches/gnome-todo-delete-esource-duplicate.patch \
%D%/packages/patches/gnome-tweaks-search-paths.patch \
%D%/packages/patches/gnupg-default-pinentry.patch \
diff --git a/gnu/packages/gnome.scm b/gnu/packages/gnome.scm
index 15719ef..aebb814 100644
--- a/gnu/packages/gnome.scm
+++ b/gnu/packages/gnome.scm
@@ -5114,7 +5114,8 @@ services for numerous locations.")
name "-" version ".tar.xz"))
(sha256
(base32
- "07y1gbicz0pbxmdgwrdzyc4byy30wfwpbqgvnx27gnpqmc5s50cr"))))
+ "07y1gbicz0pbxmdgwrdzyc4byy30wfwpbqgvnx27gnpqmc5s50cr"))
+ (patches (search-patches "gnome-settings-daemon-gc.patch"))))
(build-system meson-build-system)
(arguments
`(#:glib-or-gtk? #t
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 0000000..688544b
--- /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) {