GNOME Bugzilla – Bug 557647
Housekeeping: warn about low disk space
Last modified: 2009-03-03 21:04:56 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.
Created attachment 121213 [details] [review] Patch
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?
(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"?
(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.
Ah, I meant to look at this. Thanks for doing that patch, Vincent.
Created attachment 124020 [details] [review] Updated patch Took into account the comments, and made the notification button work (thanks Matthias for the hint).
+ 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.
Going to commit this (Vincent's last patch + 2 last comments from Jens) as soon as it builds
how will the notification behave with Notofy OSD launched with Ubuntu 9.04 ?
(In reply to comment #9) > how will the notification behave with Notofy OSD launched with Ubuntu 9.04 ? Ask Ubuntu, but not GNOME.
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!
(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().
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.
Well. As long as the new Ubuntu notifications are, well, Ubuntu notifications and not upstream notifications, it's hard for us to do anything :/
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.)
(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)
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?
(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.
(I've reported Milan's idea about emptying the Trash as bug 573980.)