After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 557647 - Housekeeping: warn about low disk space
Housekeeping: warn about low disk space
Status: RESOLVED FIXED
Product: gnome-settings-daemon
Classification: Core
Component: plugins
unspecified
Other Linux
: Normal normal
: ---
Assigned To: gnome-settings-daemon-maint
gnome-settings-daemon-maint
Depends on:
Blocks:
 
 
Reported: 2008-10-23 18:43 UTC by Vincent Untz
Modified: 2009-03-03 21:04 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Patch (16.53 KB, patch)
2008-10-23 18:44 UTC, Vincent Untz
needs-work Details | Review
Updated patch (16.46 KB, patch)
2008-12-05 19:46 UTC, Vincent Untz
committed Details | Review

Description Vincent Untz 2008-10-23 18:43:34 UTC
One goal in 2.26 would be to get rid of gnome-volume-manager -- actually, a few distributions stopped shipping it already.

But we lose the notifications about low disk space this way.

Here's a patch that moves this feature to the housekeeping plugin.
Comment 1 Vincent Untz 2008-10-23 18:44:00 UTC
Created attachment 121213 [details] [review]
Patch
Comment 2 Jens Granseuer 2008-10-23 19:00:36 UTC
Every 15 seconds seems like quite a lot. Do we really need it that often?

+        if (FALSE && has_disk_analyzer) {

?

+                g_critical ("Low disk space monitor already initialized.\n");

Is that really critical? In any case, please remove the newline.

+_Description=Automatically prunes thumbnail caches and other transient files, and warns about disk usage

Hm, disk usage is hardly something to warn about, isn't it?
Comment 3 Vincent Untz 2008-10-23 19:10:23 UTC
(In reply to comment #2)
> Every 15 seconds seems like quite a lot. Do we really need it that often?

Well, that's the value that was used in gvm. It's not that much, but I guess we can check every minute if you prefer.

> +        if (FALSE && has_disk_analyzer) {
> 
> ?

Heh :-) That's libnotify not working here: when I click on the button, nothing happens. Maybe I'm misusing the library, or it's a broken install. Help welcome.

> +                g_critical ("Low disk space monitor already initialized.\n");
> 
> Is that really critical? In any case, please remove the newline.

g_warning?

> +_Description=Automatically prunes thumbnail caches and other transient files,
> and warns about disk usage
> 
> Hm, disk usage is hardly something to warn about, isn't it?

"warns about low disk space"?
Comment 4 Jens Granseuer 2008-10-24 17:00:05 UTC
(In reply to comment #3)
> > Every 15 seconds seems like quite a lot. Do we really need it that often?
> 
> Well, that's the value that was used in gvm. It's not that much, but I guess we
> can check every minute if you prefer.

I'd prefer that.

> > +        if (FALSE && has_disk_analyzer) {
> > 
> > ?
> 
> Heh :-) That's libnotify not working here: when I click on the button, nothing
> happens. Maybe I'm misusing the library, or it's a broken install. Help
> welcome.

Hm, I don't even have libnotify installed...

> > +                g_critical ("Low disk space monitor already initialized.\n");
> > 
> > Is that really critical? In any case, please remove the newline.
> 
> g_warning?

Preferably.

> > +_Description=Automatically prunes thumbnail caches and other transient files,
> > and warns about disk usage
> > 
> > Hm, disk usage is hardly something to warn about, isn't it?
> 
> "warns about low disk space"?

Sounds better, yes.
Comment 5 Matthias Clasen 2008-11-08 05:54:41 UTC
Ah, I meant to look at this. Thanks for doing that patch, Vincent.
Comment 6 Vincent Untz 2008-12-05 19:46:21 UTC
Created attachment 124020 [details] [review]
Updated patch

Took into account the comments, and made the notification button work (thanks Matthias for the hint).
Comment 7 Jens Granseuer 2008-12-07 14:04:33 UTC
+        if (program != NULL) {
+                g_free (program);
+        }

Unnecessary check.

+        if (!notify_is_initted ())
+                if (!notify_init ("Low Disk Space Monitor"))
+                        return;

Please use braces for blocks > 1 line.

The rest of the patch looks good, please commit with those two changes.
Comment 8 Rodrigo Moya 2008-12-30 23:59:33 UTC
Going to commit this (Vincent's last patch + 2 last comments from Jens) as soon as it builds
Comment 9 antistress 2009-02-27 09:05:54 UTC
how will the notification behave with Notofy OSD launched with Ubuntu 9.04 ?
Comment 10 André Klapper 2009-02-27 10:59:56 UTC
(In reply to comment #9)
> how will the notification behave with Notofy OSD launched with Ubuntu 9.04 ?

Ask Ubuntu, but not GNOME.
Comment 11 Milan Bouchet-Valat 2009-02-27 16:06:57 UTC
antistress: with OSD notify, that will probably become dialog. That's the main problem of this new Ubuntu system (though here it's not really a drawback since the notification is really urgent).

Vincent: I think I've read that the desktop notification spec says you must check whether the server supports action before adding one. This will allow the new Ubuntu server to refuse them, and to avoid falling back to dialogs:

+                notify_notification_add_action (notif, "analyze", _("Analyze"),
+                                                (NotifyActionCallback) ldsm_notification_clicked,
+                                                g_strdup (path), g_free);


Anyway, the feature is great!
Comment 12 Vincent Untz 2009-02-27 16:27:42 UTC
(In reply to comment #11)
> Vincent: I think I've read that the desktop notification spec says you must
> check whether the server supports action before adding one. This will allow the
> new Ubuntu server to refuse them, and to avoid falling back to dialogs:

That'd be a bug in the library: if the server doesn't support action, then the library should do a noop for notify_notification_add_action().
Comment 13 Milan Bouchet-Valat 2009-02-27 17:18:22 UTC
That's what I'd  expected too, but that's apparently not what it does:
https://wiki.ubuntu.com/NotificationDevelopmentGuidelines#Target%20developer-audience

I can find a rationale to that: if you know the server won't support actions, you can do something else, rather than merely showing a text (e.g. here, show a dialog). But I don't think anybody uses this, and the server can do it automatically. That's really the losy part of the new Ubuntu notifications. If this is stupid, it would be good to change the guidelines before all apps are made compliant to it (as the wiki page explains). That's not a problem specific to gnome-settings-daemon, anyway.
Comment 14 Vincent Untz 2009-02-27 17:21:49 UTC
Well. As long as the new Ubuntu notifications are, well, Ubuntu notifications and not upstream notifications, it's hard for us to do anything :/
Comment 15 Matthew Paul Thomas (mpt) 2009-02-27 23:26:29 UTC
It's odd to say Notify OSD isn't "upstream notifications": Canonical is currently the upstream for Notify OSD in the same way that Mozilla is the upstream for Firefox. But anyway...

To answer the question of why Notify OSD doesn't just ignore actions (comment 13), it's because there are all sorts of little programs -- probably including privately-distributed scripts and applets we know nothing about -- that just assume all notification servers will present actions. (Thanks to Christian Hammond for helping us understand this.) So it was better for us to provide a fallback mechanism, and collaborate with other upstream projects to fix the apps that assume actions are available, than to just swallow them and make some programs/functions useless.

For the specific case of low disk space, I think it's important enough to warrant a human response, but usually not urgent enough to float on top of everything else, therefore the appropriate presentation is a standard alert box. I would say that even if Notify OSD didn't exist -- but if you don't believe me, ;-) you have the option of using a bubble if getCapabilities returns "actions" or an alert if it doesn't. (A custom alert would have several benefits over a Notify OSD fallback alert, most importantly that it wouldn't have "Cancel" and "OK" buttons that do the same thing.)
Comment 16 Vincent Untz 2009-02-27 23:48:43 UTC
(In reply to comment #15)
> It's odd to say Notify OSD isn't "upstream notifications": Canonical is
> currently the upstream for Notify OSD in the same way that Mozilla is the
> upstream for Firefox. But anyway...

Let me rephrase it this way if you prefer: GNOME depends on libnotify, not on notify osd.

I've nothing against it (I think I'd be easy to convince that it can be an improvement), but it has never been discussed in upstream GNOME, so it's a bit weird to try to fix an issue here for something that GNOME upstream doesn't use.

I mean, it's similar to saying: openSUSE is using YaST. And we need gnome-user-share to call YaST to open the right port in the firewall.

(that being said, as usual, if someone writes a patch, the maintainers might look at it)
Comment 17 Milan Bouchet-Valat 2009-03-01 17:05:18 UTC
Vincent: to me, one of the main actions to perform when free disk space is low is emptying the trash. Then you can analyse disk usage, but that's a more complex action you may not want to do immediately. What about adding an "Empty Trash" action?
Comment 18 Vincent Untz 2009-03-01 22:35:38 UTC
(In reply to comment #17)
> Vincent: to me, one of the main actions to perform when free disk space is low
> is emptying the trash. Then you can analyse disk usage, but that's a more
> complex action you may not want to do immediately. What about adding an "Empty
> Trash" action?

Please file a new bug. This bug is closed, so if you think something should be improved, your idea might get lost here.
Comment 19 Matthew Paul Thomas (mpt) 2009-03-03 21:04:56 UTC
(I've reported Milan's idea about emptying the Trash as bug 573980.)