From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp0 ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms11 with LMTPS id 4LW8EUNZY18aZwAA0tVLHw (envelope-from ) for ; Thu, 17 Sep 2020 12:40:35 +0000 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp0 with LMTPS id OOaSDUNZY1+SYwAA1q6Kng (envelope-from ) for ; Thu, 17 Sep 2020 12:40:35 +0000 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 9B66E94051B for ; Thu, 17 Sep 2020 12:40:34 +0000 (UTC) Received: from localhost ([::1]:42256 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kItDF-0002LE-Fy for larch@yhetil.org; Thu, 17 Sep 2020 08:40:33 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:39142) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kItCL-0001uS-LA for guix-devel@gnu.org; Thu, 17 Sep 2020 08:39:37 -0400 Received: from mail3-relais-sop.national.inria.fr ([192.134.164.104]:15148) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kItCJ-0005VS-08 for guix-devel@gnu.org; Thu, 17 Sep 2020 08:39:37 -0400 X-IronPort-AV: E=Sophos;i="5.76,436,1592863200"; d="scan'208";a="359296061" Received: from unknown (HELO ribbon) ([193.50.110.192]) by mail3-relais-sop.national.inria.fr with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 17 Sep 2020 14:39:30 +0200 From: =?utf-8?Q?Ludovic_Court=C3=A8s?= To: Guix Devel Subject: GNOME: Suggesting =?utf-8?B?4oCYZ3VpeCBnY+KAmQ==?= upon low disk space X-URL: http://www.fdn.fr/~lcourtes/ X-Revolutionary-Date: Jour du =?utf-8?Q?G=C3=A9nie?= de =?utf-8?Q?l'Ann?= =?utf-8?Q?=C3=A9e?= 228 de la =?utf-8?Q?R=C3=A9volution?= X-PGP-Key-ID: 0x090B11993D9AEBB5 X-PGP-Key: http://www.fdn.fr/~lcourtes/ludovic.asc X-PGP-Fingerprint: 3CE4 6455 8A84 FDC6 9DB4 0CFB 090B 1199 3D9A EBB5 X-OS: x86_64-pc-linux-gnu Date: Thu, 17 Sep 2020 14:39:30 +0200 Message-ID: <87y2l8shkt.fsf@inria.fr> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.1 (gnu/linux) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Received-SPF: pass client-ip=192.134.164.104; envelope-from=ludovic.courtes@inria.fr; helo=mail3-relais-sop.national.inria.fr X-detected-operating-system: by eggs.gnu.org: First seen = 2020/09/17 08:39:31 X-ACL-Warn: Detected OS = ??? X-Spam_score_int: -68 X-Spam_score: -6.9 X-Spam_bar: ------ X-Spam_report: (-6.9 / 5.0 requ) BAYES_00=-1.9, RCVD_IN_DNSWL_HI=-5, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: guix-devel@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "Development of GNU Guix and the GNU System distribution." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-devel-bounces+larch=yhetil.org@gnu.org Sender: "Guix-devel" X-Scanner: scn0 Authentication-Results: aspmx1.migadu.com; dkim=none; dmarc=none; spf=pass (aspmx1.migadu.com: domain of guix-devel-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=guix-devel-bounces@gnu.org X-Spam-Score: -1.01 X-TUID: AgqCGgNDTIY7 --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Hello Guix! GNOME (actually =E2=80=98gnome-settings-daemon=E2=80=99) pops up a notifica= tion upon low disk space that looks like this: Low Disk Space on =E2=80=9Cfilesystem root=E2=80=9D [ Empty Trash ] [ Examine ] The =E2=80=9CExamine=E2=80=9D button spawns the Disk Space Analyzer (aka Ba= obab) and the =E2=80=9CEmpty Trash=E2=80=9D button does its thing. The untested patch below adds a =E2=80=98guix gc=E2=80=99 button, which is = probably more important than the other two on Guix System. I=E2=80=99m not sure whether implementing it is as simple as this: is it OK= to block during GC or should it be done in a separate process? If someone here has more insight or would like to give it a try, please let me know! Ludo=E2=80=99. --=-=-= Content-Type: text/x-patch Content-Disposition: inline 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) { --=-=-=--