diff --git a/plugins/housekeeping/gsd-disk-space.c b/plugins/housekeeping/gsd-disk-space.c index bd3437e..870430b 100644 --- a/plugins/housekeeping/gsd-disk-space.c +++ b/plugins/housekeeping/gsd-disk-space.c @@ -546,6 +546,20 @@ empty_trash_callback (NotifyNotification *n, notify_notification_close (n, NULL); } +static void +guix_gc_callback (NotifyNotification *n, + const char *action) +{ + GDateTime *old; + + g_assert (action != NULL); + g_assert (strcmp (action, "run-guix-gc") == 0); + + system ("guix gc"); + + notify_notification_close (n, NULL); +} + static void on_notification_closed (NotifyNotification *n) { @@ -591,6 +605,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) {