Index: plugins/gdu/gdu.gnome-settings-plugin.in
===================================================================
--- plugins/gdu/gdu.gnome-settings-plugin.in	(revision 0)
+++ plugins/gdu/gdu.gnome-settings-plugin.in	(revision 0)
@@ -0,0 +1,8 @@
+[GNOME Settings Plugin]
+Module=gdu
+IAge=0
+_Name=gnome-disk-utility integration
+_Description=DeviceKit-disks notifications (S.M.A.R.T. warnings, RAID array degradation)
+Authors=Tomáš Bžatek
+Copyright=Copyright © 2009 Tomáš Bžatek
+Website=
Index: plugins/gdu/gsd-gdu-manager.c
===================================================================
--- plugins/gdu/gsd-gdu-manager.c	(revision 0)
+++ plugins/gdu/gsd-gdu-manager.c	(revision 0)
@@ -0,0 +1,413 @@
+/*
+ * Copyright (C) 2009 Tomas Bzatek <tbzatek@redhat.com>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ *
+ */
+
+#include "config.h"
+#include <time.h>
+
+#include <glib/gi18n.h>
+#include <gconf/gconf-client.h>
+#include <gio/gio.h>
+#include <glib/gstdio.h>
+#include <string.h>
+#include <gdu/gdu.h>
+
+#include <libnotify/notify.h>
+
+#include "gnome-settings-profile.h"
+#include "gsd-gdu-manager.h"
+
+
+
+#define DISK_MANAGEMENT_UTILITY  "palimpsest"
+#define NOTIFICATION_DUPLICATION_TIMEOUT  10   /*  10 seconds  */
+
+
+struct GsdGDUManagerPrivate {
+  GduPool *pool;
+  GHashTable *monitored;
+};
+
+typedef struct {
+  GduPresentable *presentable;
+  GduDevice *device;
+  GtkStatusIcon *status_icon;
+
+  time_t last_smart_warning;
+  time_t last_md_warning;
+
+  GsdGDUManager *manager;   /*  TODO: I don't like circular references  */
+} GsdGduWatch;
+
+
+#define GSD_GDU_MANAGER_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), GSD_TYPE_GDU_MANAGER, GsdGDUManagerPrivate))
+
+static void     gsd_gdu_manager_class_init  (GsdGDUManagerClass *klass);
+static void     gsd_gdu_manager_init        (GsdGDUManager      *gdu_manager);
+
+G_DEFINE_TYPE (GsdGDUManager, gsd_gdu_manager, G_TYPE_OBJECT)
+
+static gpointer manager_object = NULL;
+
+
+/* ------------------------------------------------------------------------------------------------- */
+
+static gboolean
+presentable_is_toplevel (GduPresentable *presentable)
+{
+  GduPresentable *toplevel_presentable;
+  gboolean res = FALSE;
+
+  g_return_val_if_fail (presentable != NULL, FALSE);
+
+  toplevel_presentable = gdu_presentable_get_toplevel (presentable);
+  if (toplevel_presentable) {
+    res = presentable == toplevel_presentable;
+    g_object_unref (toplevel_presentable);
+  }
+
+  return res;
+}
+
+static char *
+g_icon_get_string (GIcon *icon)
+{
+  const char *icon_text = NULL;
+  const char * const *icon_names;
+
+  if (! icon)
+    return NULL;
+
+  if (G_IS_THEMED_ICON (icon)) {
+    icon_names = g_themed_icon_get_names (G_THEMED_ICON (icon));
+    while (icon_text == NULL && icon_names != NULL && *icon_names != NULL) {
+      if (gtk_icon_theme_has_icon (gtk_icon_theme_get_default (), *icon_names))
+        icon_text = *icon_names;
+      icon_names++;
+    }
+  }
+
+  return g_strdup (icon_text);
+}
+
+/* ------------------------------------------------------------------------------------------------- */
+
+static void
+do_investigate (GsdGduWatch *watch)
+{
+  g_spawn_command_line_async (DISK_MANAGEMENT_UTILITY, NULL);
+
+  if (watch->status_icon != NULL) {
+    g_object_unref (watch->status_icon);
+    watch->status_icon = NULL;
+  }
+}
+
+static void
+status_icon_clicked (GtkStatusIcon *status_icon, gpointer user_data)
+{
+  do_investigate (user_data);
+}
+
+static void
+notification_clicked (NotifyNotification *notification, gchar *action, gpointer user_data)
+{
+  if (strcmp (action, "investigate") != 0)
+    return;
+
+  do_investigate (user_data);
+}
+
+
+static void
+gdu_show_notification (GsdGduWatch *watch, char *title, char *message)
+{
+  NotifyNotification *notif;
+  GIcon *icon;
+  char *icon_text = NULL;
+  char *program;
+  char *s;
+
+  program = g_find_program_in_path (DISK_MANAGEMENT_UTILITY);
+  icon = gdu_presentable_get_icon (watch->presentable);
+  if (icon) {
+    icon_text = g_icon_get_string (icon);
+    g_object_unref (icon);
+  }
+
+  notif = notify_notification_new (title, message, icon_text, NULL);
+
+  notify_notification_set_urgency (notif, NOTIFY_URGENCY_CRITICAL);
+
+  if (program != NULL) {
+          notify_notification_add_action (notif, "investigate", _("Investigate"),
+                                          (NotifyActionCallback) notification_clicked,
+                                          watch, NULL);
+  }
+
+  g_signal_connect (notif, "closed", G_CALLBACK (g_object_unref), NULL);
+  notify_notification_show (notif, NULL);
+
+  /*  Show status icon only once  */
+  if (watch->status_icon == NULL) {
+    watch->status_icon = gtk_status_icon_new_from_stock (GTK_STOCK_DIALOG_WARNING);
+    s = g_strdup_printf ("<b>%s</b>\n\n%s", title, message);
+    gtk_status_icon_set_tooltip_markup (watch->status_icon, s);
+    g_signal_connect (watch->status_icon, "activate", G_CALLBACK (status_icon_clicked), watch);
+    g_free (s);
+  }
+
+  if (program)
+    g_free (program);
+  if (icon_text)
+    g_free (icon_text);
+}
+
+static void
+watch_check_state (GsdGduWatch *watch)
+{
+  GduDevice *device;
+  char *title;
+  GduSmartData *smart;
+
+  g_return_if_fail (watch != NULL);
+  g_return_if_fail (watch->presentable != NULL);
+
+  device = gdu_presentable_get_device (watch->presentable);
+  if (! device)
+    return;
+
+  title = g_strdup_printf ("%s (%s)", gdu_presentable_get_name (watch->presentable), gdu_device_get_device_file (device));
+
+  /*  S.M.A.R.T.  */
+  if (time (NULL) > watch->last_smart_warning + NOTIFICATION_DUPLICATION_TIMEOUT &&
+      gdu_device_drive_smart_get_is_capable (device) && gdu_device_drive_smart_get_is_enabled (device))
+  {
+    smart = gdu_device_get_smart_data (device);
+    if (smart) {
+      if (gdu_smart_data_get_is_failing (smart)) {
+        gdu_show_notification (watch, title, _("S.M.A.R.T. subsystem reported hardware failure. There's high risk of data loss."));
+        watch->last_smart_warning = time (NULL);
+      }
+      g_object_unref (smart);
+    }
+  }
+
+  /*  RAID  */
+  if (time (NULL) > watch->last_md_warning + NOTIFICATION_DUPLICATION_TIMEOUT &&
+      gdu_device_is_linux_md (device) && gdu_device_linux_md_is_degraded (device))
+  {
+    gdu_show_notification (watch, title, _("The array is running in degraded mode. There's a chance of data loss when device fails."));
+    watch->last_md_warning = time (NULL);
+  }
+
+  g_free (title);
+  g_object_unref (device);
+}
+
+/* ------------------------------------------------------------------------------------------------- */
+
+/*  forward declarations  */
+static void recreate_watch (GsdGDUManager *manager, GduPresentable *presentable);
+
+
+static void
+device_changed (GduDevice *gdudevice, gpointer user_data)
+{
+  watch_check_state (user_data);
+}
+
+static void
+device_removed (GduDevice *gdudevice, gpointer user_data)
+{
+  GsdGduWatch *watch = user_data;
+
+  recreate_watch (watch->manager, watch->presentable);
+}
+
+static void
+add_monitor (GsdGDUManager *manager, GduPresentable *presentable)
+{
+  GsdGDUManagerPrivate *p = manager->priv;
+  GsdGduWatch *watch;
+
+  g_return_if_fail (presentable != NULL);
+  /*  We want only toplevel presentables to watch  */
+  if (! presentable_is_toplevel (presentable))
+    return;
+
+  watch = g_malloc0 (sizeof (GsdGduWatch));
+  watch->manager = manager;
+  watch->presentable = g_object_ref (presentable);
+  watch->device = gdu_presentable_get_device (presentable);
+  if (watch->device) {
+    g_signal_connect (watch->device, "changed", G_CALLBACK (device_changed), watch);
+    g_signal_connect (watch->device, "removed", G_CALLBACK (device_removed), watch);
+  }
+  g_hash_table_insert (p->monitored, g_object_ref (presentable), watch);
+
+  g_debug ("GDU: monitoring '%s' (%s)", gdu_presentable_get_name (presentable), watch->device ? gdu_device_get_device_file (watch->device) : "no device");
+  /*  check status when user logs in  */
+  watch_check_state (watch);
+}
+
+static void
+monitored_list_free_data (gpointer data)
+{
+  GsdGduWatch *watch = data;
+
+  g_return_if_fail (data != NULL);
+
+  if (watch->device) {
+    g_signal_handlers_disconnect_matched (watch->device, G_SIGNAL_MATCH_DATA, 0, 0, NULL, NULL, watch);
+    g_object_unref (watch->device);
+  }
+  g_object_unref (watch->presentable);
+  if (watch->status_icon)
+    g_object_unref (watch->status_icon);
+  g_free (watch);
+}
+
+static void
+recreate_watch (GsdGDUManager *manager, GduPresentable *presentable)
+{
+  g_hash_table_remove (manager->priv->monitored, presentable);
+  add_monitor (manager, presentable);
+}
+
+static void
+monitored_list_populate (GsdGDUManager *manager)
+{
+  GsdGDUManagerPrivate *p = manager->priv;
+  GList *presentables, *l;
+
+  presentables = gdu_pool_get_presentables (p->pool);
+
+  for (l = presentables; l != NULL; l = l->next) {
+    if (l->data)
+      add_monitor (manager, l->data);
+  }
+
+  g_list_foreach (presentables, (GFunc) g_object_unref, NULL);
+  g_list_free (presentables);
+}
+
+/* ------------------------------------------------------------------------------------------------- */
+
+static void
+pool_presentable_added (GduPool *pool, GduPresentable *presentable, gpointer user_data)
+{
+  if (presentable_is_toplevel (presentable)) {
+    add_monitor (user_data, presentable);
+  }
+}
+
+static void
+pool_presentable_removed (GduPool *pool, GduPresentable *presentable, gpointer user_data)
+{
+  GsdGDUManagerPrivate *p = ((GsdGDUManager *)user_data)->priv;
+
+  g_hash_table_remove (p->monitored, presentable);
+}
+
+static void
+pool_presentable_changed (GduPool *pool, GduPresentable *presentable, gpointer user_data)
+{
+  GsdGduWatch *watch;
+  GsdGDUManagerPrivate *p = ((GsdGDUManager *)user_data)->priv;
+
+  watch = g_hash_table_lookup (p->monitored, presentable);
+  if (watch)
+    watch_check_state (watch);
+}
+
+/* ------------------------------------------------------------------------------------------------- */
+
+gboolean
+gsd_gdu_manager_start (GsdGDUManager *manager,
+                       GError       **error)
+{
+  GsdGDUManagerPrivate *p = manager->priv;
+
+  g_debug ("Starting GDU manager");
+  gnome_settings_profile_start (NULL);
+
+  p->pool = gdu_pool_new ();
+  g_signal_connect (p->pool, "presentable-added", G_CALLBACK (pool_presentable_added), manager);
+  g_signal_connect (p->pool, "presentable-changed", G_CALLBACK (pool_presentable_changed), manager);
+  g_signal_connect (p->pool, "presentable-removed", G_CALLBACK (pool_presentable_removed), manager);
+  p->monitored = g_hash_table_new_full (g_direct_hash, g_direct_equal, g_object_unref, monitored_list_free_data);
+
+  /*  Populate the devices and start monitoring  */
+  monitored_list_populate (manager);
+
+  gnome_settings_profile_end (NULL);
+
+  return TRUE;
+}
+
+
+void
+gsd_gdu_manager_stop (GsdGDUManager *manager)
+{
+  GsdGDUManagerPrivate *p = manager->priv;
+
+  g_debug ("Stopping GDU manager");
+
+  g_hash_table_unref (p->monitored);
+
+  g_signal_handlers_disconnect_matched (p->pool, G_SIGNAL_MATCH_DATA, 0, 0, NULL, NULL, manager);
+  g_object_unref (p->pool);
+}
+
+
+static void
+gsd_gdu_manager_class_init (GsdGDUManagerClass *klass)
+{
+  g_type_class_add_private (klass, sizeof (GsdGDUManagerPrivate));
+}
+
+
+static void
+gsd_gdu_manager_init (GsdGDUManager *manager)
+{
+  manager->priv = GSD_GDU_MANAGER_GET_PRIVATE (manager);
+}
+
+
+GsdGDUManager *
+gsd_gdu_manager_new (void)
+{
+  if (manager_object != NULL) {
+    g_object_ref (manager_object);
+  } else {
+    manager_object = g_object_new (GSD_TYPE_GDU_MANAGER, NULL);
+    g_object_add_weak_pointer (manager_object, (gpointer *) &manager_object);
+  }
+
+  return GSD_GDU_MANAGER (manager_object);
+}
+
+
+
+/* TODO:  NO - do we need to poll SMART values or is that refreshed automatically by DK-disks daemon? (looks like it's pooled every 30 minutes?)
+ *        DONE - multiple changed events at one time, avoid duplicate notifications ???
+ *        - delayed write? how can we detect that?
+ *        - The "Investigate" button should spawn palimpsest with the selected (failing) device
+ *
+ */
Index: plugins/gdu/gsd-gdu-plugin.c
===================================================================
--- plugins/gdu/gsd-gdu-plugin.c	(revision 0)
+++ plugins/gdu/gsd-gdu-plugin.c	(revision 0)
@@ -0,0 +1,103 @@
+/*
+ * Copyright (C) 2009 Tomas Bzatek <tbzatek@redhat.com>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2, or (at your option)
+ * any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ *
+ */
+
+#include "config.h"
+
+#include <glib/gi18n-lib.h>
+#include <gmodule.h>
+
+#include "gnome-settings-plugin.h"
+#include "gsd-gdu-plugin.h"
+#include "gsd-gdu-manager.h"
+
+struct GsdGDUPluginPrivate {
+        GsdGDUManager *manager;
+};
+
+#define GSD_GDU_PLUGIN_GET_PRIVATE(object) (G_TYPE_INSTANCE_GET_PRIVATE ((object), GSD_TYPE_GDU_PLUGIN, GsdGDUPluginPrivate))
+
+GNOME_SETTINGS_PLUGIN_REGISTER (GsdGDUPlugin, gsd_gdu_plugin)
+
+static void
+gsd_gdu_plugin_init (GsdGDUPlugin *plugin)
+{
+        plugin->priv = GSD_GDU_PLUGIN_GET_PRIVATE (plugin);
+
+        g_debug ("GsdGDUPlugin initializing");
+
+        plugin->priv->manager = gsd_gdu_manager_new ();
+}
+
+static void
+gsd_gdu_plugin_finalize (GObject *object)
+{
+        GsdGDUPlugin *plugin;
+
+        g_return_if_fail (object != NULL);
+        g_return_if_fail (GSD_IS_GDU_PLUGIN (object));
+
+        g_debug ("GsdGDUPlugin finalizing");
+
+        plugin = GSD_GDU_PLUGIN (object);
+
+        g_return_if_fail (plugin->priv != NULL);
+
+        if (plugin->priv->manager != NULL) {
+                g_object_unref (plugin->priv->manager);
+        }
+
+        G_OBJECT_CLASS (gsd_gdu_plugin_parent_class)->finalize (object);
+}
+
+static void
+impl_activate (GnomeSettingsPlugin *plugin)
+{
+        gboolean res;
+        GError  *error;
+
+        g_debug ("Activating GDU plugin");
+
+        error = NULL;
+        res = gsd_gdu_manager_start (GSD_GDU_PLUGIN (plugin)->priv->manager, &error);
+        if (! res) {
+                g_warning ("Unable to start GDU manager: %s", error->message);
+                g_error_free (error);
+        }
+}
+
+static void
+impl_deactivate (GnomeSettingsPlugin *plugin)
+{
+        g_debug ("Deactivating GDU plugin");
+        gsd_gdu_manager_stop (GSD_GDU_PLUGIN (plugin)->priv->manager);
+}
+
+static void
+gsd_gdu_plugin_class_init (GsdGDUPluginClass *klass)
+{
+        GObjectClass             *object_class = G_OBJECT_CLASS (klass);
+        GnomeSettingsPluginClass *plugin_class = GNOME_SETTINGS_PLUGIN_CLASS (klass);
+
+        object_class->finalize = gsd_gdu_plugin_finalize;
+
+        plugin_class->activate = impl_activate;
+        plugin_class->deactivate = impl_deactivate;
+
+        g_type_class_add_private (klass, sizeof (GsdGDUPluginPrivate));
+}
Index: plugins/gdu/gsd-gdu-manager.h
===================================================================
--- plugins/gdu/gsd-gdu-manager.h	(revision 0)
+++ plugins/gdu/gsd-gdu-manager.h	(revision 0)
@@ -0,0 +1,54 @@
+/*
+ * Copyright (C) 2009 Tomas Bzatek <tbzatek@redhat.com>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ *
+ */
+
+#ifndef __GSD_GDU_MANAGER_H
+#define __GSD_GDU_MANAGER_H
+
+#include <glib-object.h>
+
+G_BEGIN_DECLS
+
+#define GSD_TYPE_GDU_MANAGER         (gsd_gdu_manager_get_type ())
+#define GSD_GDU_MANAGER(o)           (G_TYPE_CHECK_INSTANCE_CAST ((o), GSD_TYPE_GDU_MANAGER, GsdGDUManager))
+#define GSD_GDU_MANAGER_CLASS(k)     (G_TYPE_CHECK_CLASS_CAST((k), GSD_TYPE_GDU_MANAGER, GsdGDUManagerClass))
+#define GSD_IS_GDU_MANAGER(o)        (G_TYPE_CHECK_INSTANCE_TYPE ((o), GSD_TYPE_GDU_MANAGER))
+#define GSD_IS_GDU_MANAGER_CLASS(k)  (G_TYPE_CHECK_CLASS_TYPE ((k), GSD_TYPE_GDU_MANAGER))
+#define GSD_GDU_MANAGER_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), GSD_TYPE_GDU_MANAGER, GsdGDUManagerClass))
+
+typedef struct GsdGDUManagerPrivate GsdGDUManagerPrivate;
+
+typedef struct {
+        GObject                parent;
+        GsdGDUManagerPrivate  *priv;
+} GsdGDUManager;
+
+typedef struct {
+        GObjectClass   parent_class;
+} GsdGDUManagerClass;
+
+GType              gsd_gdu_manager_get_type      (void);
+
+GsdGDUManager    * gsd_gdu_manager_new           (void);
+gboolean           gsd_gdu_manager_start         (GsdGDUManager  *manager,
+                                                  GError        **error);
+void               gsd_gdu_manager_stop          (GsdGDUManager  *manager);
+
+G_END_DECLS
+
+#endif /* __GSD_GDU_MANAGER_H */
Index: plugins/gdu/Makefile.am
===================================================================
--- plugins/gdu/Makefile.am	(revision 0)
+++ plugins/gdu/Makefile.am	(revision 0)
@@ -0,0 +1,44 @@
+plugin_in_files = gdu.gnome-settings-plugin.in
+
+
+if HAVE_GDU
+plugin_LTLIBRARIES = libgdu.la
+
+libgdu_la_SOURCES = 		\
+	gsd-gdu-manager.c	\
+	gsd-gdu-manager.h	\
+	gsd-gdu-plugin.c	\
+	gsd-gdu-plugin.h
+
+libgdu_la_CPPFLAGS = 						\
+	-I$(top_srcdir)/gnome-settings-daemon			\
+	-DGNOME_SETTINGS_LOCALEDIR=\""$(datadir)/locale"\"	\
+	-DGDU_API_IS_SUBJECT_TO_CHANGE				\
+	$(AM_CPPFLAGS)
+
+libgdu_la_CFLAGS = 		\
+	$(SETTINGS_PLUGIN_CFLAGS)	\
+	$(GIOUNIX_CFLAGS)		\
+	$(LIBNOTIFY_CFLAGS)		\
+	$(LIBGDU_CFLAGS)		\
+	$(AM_CFLAGS)
+
+libgdu_la_LDFLAGS = $(GSD_PLUGIN_LDFLAGS)
+
+libgdu_la_LIBADD = 	\
+	$(top_builddir)/gnome-settings-daemon/libgsd-plugins.la \
+	$(SETTINGS_PLUGIN_LIBS)	\
+	$(GIOUNIX_LIBS)		\
+	$(LIBNOTIFY_LIBS)	\
+	$(LIBGDU_LIBS)
+
+plugin_DATA = $(plugin_in_files:.gnome-settings-plugin.in=.gnome-settings-plugin)
+endif
+
+EXTRA_DIST = $(plugin_in_files)
+
+CLEANFILES = $(plugin_DATA)
+
+DISTCLEANFILES = (plugin_DATA)
+
+@GSD_INTLTOOL_PLUGIN_RULE@
Index: plugins/gdu/gsd-gdu-plugin.h
===================================================================
--- plugins/gdu/gsd-gdu-plugin.h	(revision 0)
+++ plugins/gdu/gsd-gdu-plugin.h	(revision 0)
@@ -0,0 +1,56 @@
+/*
+ * Copyright (C) 2009 Tomas Bzatek <tbzatek@redhat.com>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2, or (at your option)
+ * any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ *
+ */
+
+#ifndef __GSD_GDU_PLUGIN_H__
+#define __GSD_GDU_PLUGIN_H__
+
+#include <glib.h>
+#include <glib-object.h>
+#include <gmodule.h>
+
+#include "gnome-settings-plugin.h"
+
+G_BEGIN_DECLS
+
+#define GSD_TYPE_GDU_PLUGIN                (gsd_gdu_plugin_get_type ())
+#define GSD_GDU_PLUGIN(o)                  (G_TYPE_CHECK_INSTANCE_CAST ((o), GSD_TYPE_GDU_PLUGIN, GsdGDUPlugin))
+#define GSD_GDU_PLUGIN_CLASS(k)            (G_TYPE_CHECK_CLASS_CAST((k), GSD_TYPE_GDU_PLUGIN, GsdGDUPluginClass))
+#define GSD_IS_GDU_PLUGIN(o)               (G_TYPE_CHECK_INSTANCE_TYPE ((o), GSD_TYPE_GDU_PLUGIN))
+#define GSD_IS_GDU_PLUGIN_CLASS(k)         (G_TYPE_CHECK_CLASS_TYPE ((k), GSD_TYPE_GDU_PLUGIN))
+#define GSD_GDU_PLUGIN_GET_CLASS(o)        (G_TYPE_INSTANCE_GET_CLASS ((o), GSD_TYPE_GDU_PLUGIN, GsdGDUPluginClass))
+
+typedef struct GsdGDUPluginPrivate GsdGDUPluginPrivate;
+
+typedef struct {
+        GnomeSettingsPlugin	 parent;
+        GsdGDUPluginPrivate	*priv;
+} GsdGDUPlugin;
+
+typedef struct {
+        GnomeSettingsPluginClass parent_class;
+} GsdGDUPluginClass;
+
+GType   gsd_gdu_plugin_get_type		(void) G_GNUC_CONST;
+
+/* All the plugins must implement this function */
+G_MODULE_EXPORT GType register_gnome_settings_plugin	(GTypeModule *module);
+
+G_END_DECLS
+
+#endif /* __GSD_GDU_PLUGIN_H__ */
Index: plugins/Makefile.am
===================================================================
--- plugins/Makefile.am	(revision 767)
+++ plugins/Makefile.am	(working copy)
@@ -7,7 +7,8 @@
 	clipboard	\
 	dummy		\
 	font		\
-	housekeeping    \
+	gdu		\
+	housekeeping	\
 	keybindings	\
 	keyboard	\
 	media-keys	\
Index: configure.ac
===================================================================
--- configure.ac	(revision 767)
+++ configure.ac	(working copy)
@@ -51,6 +51,7 @@
 GIO_REQUIRED_VERSION=2.17.3
 GNOME_DESKTOP_REQUIRED_VERSION=2.25.6
 LIBNOTIFY_REQUIRED_VERSION=0.4.3
+LIBGDU_REQUIRED_VERSION=0.2
 
 EXTRA_COMPILE_WARNINGS(yes)
 
@@ -106,6 +107,29 @@
 AC_SUBST(LIBNOTIFY_LIBS)
 
 dnl ---------------------------------------------------------------------------
+dnl - Check for libgdu
+dnl ---------------------------------------------------------------------------
+
+have_gdu=no
+AC_ARG_WITH(gdu,
+	AC_HELP_STRING([--without-gdu], [Disable gnome-disk-utility integration (default: auto)]),
+	with_gdu=$withval, with_gdu=auto)
+
+dnl -- we need libnotify, otherwise gdu plugin would become totally useless
+if test "x$with_gdu" != "xno" -a "$have_libnotify" == "yes"; then
+	PKG_CHECK_MODULES(LIBGDU, gdu >= $LIBGDU_REQUIRED_VERSION,
+			  [AC_DEFINE(HAVE_GDU, 1, [Define if libgdu is available])
+			  have_gdu=yes], have_gdu=no)
+	if test "x$have_gdu" = xno -a "x$with_gdu" = xyes; then
+		AC_MSG_ERROR([GDU support requested but libraries not found])
+	fi
+fi
+AC_SUBST(LIBGDU_CFLAGS)
+AC_SUBST(LIBGDU_LIBS)
+AM_CONDITIONAL(HAVE_GDU, test x"$have_gdu" = "xyes")
+
+
+dnl ---------------------------------------------------------------------------
 dnl - Check for D-Bus
 dnl ---------------------------------------------------------------------------
 
@@ -351,6 +375,7 @@
 plugins/common/Makefile
 plugins/dummy/Makefile
 plugins/font/Makefile
+plugins/gdu/Makefile
 plugins/housekeeping/Makefile
 plugins/keybindings/Makefile
 plugins/keyboard/Makefile
@@ -379,24 +404,25 @@
                     gnome-settings-daemon $VERSION
                     =============================
 
-	prefix:                   ${prefix}
-	exec_prefix:              ${exec_prefix}
-        libdir:                   ${libdir}
-        bindir:                   ${bindir}
-        sbindir:                  ${sbindir}
-        sysconfdir:               ${sysconfdir}
-        sysconfsubdir:            ${sysconfsubdir}
-        localstatedir:            ${localstatedir}
-        plugindir:                ${plugindir}
-        datadir:                  ${datadir}
-	source code location:	  ${srcdir}
-	compiler:		  ${CC}
-	cflags:		          ${CFLAGS}
-        Maintainer mode:          ${USE_MAINTAINER_MODE}
+	prefix:                      ${prefix}
+	exec_prefix:                 ${exec_prefix}
+        libdir:                      ${libdir}
+        bindir:                      ${bindir}
+        sbindir:                     ${sbindir}
+        sysconfdir:                  ${sysconfdir}
+        sysconfsubdir:               ${sysconfsubdir}
+        localstatedir:               ${localstatedir}
+        plugindir:                   ${plugindir}
+        datadir:                     ${datadir}
+	source code location:	     ${srcdir}
+	compiler:		     ${CC}
+	cflags:			     ${CFLAGS}
+        Maintainer mode:             ${USE_MAINTAINER_MODE}
 
-        dbus-1 system.d dir:      ${DBUS_SYS_DIR}
+        dbus-1 system.d dir:         ${DBUS_SYS_DIR}
 
-        Libnotify support:        ${have_libnotify}
-        PulseAudio support:       ${have_pulse}
-        Profiling support:        ${enable_profiling}
+        Libnotify support:           ${have_libnotify}
+        PulseAudio support:          ${have_pulse}
+        gnome-disk-utility support:  ${have_gdu}
+        Profiling support:           ${enable_profiling}
 "
Index: data/gnome-settings-daemon.schemas.in
===================================================================
--- data/gnome-settings-daemon.schemas.in	(revision 767)
+++ data/gnome-settings-daemon.schemas.in	(working copy)
@@ -95,6 +95,29 @@
     </schema>
 
     <schema>
+      <key>/schemas/apps/gnome_settings_daemon/plugins/gdu/active</key>
+      <applyto>/apps/gnome_settings_daemon/plugins/gdu/active</applyto>
+      <owner>gnome-settings-daemon</owner>
+      <type>bool</type>
+      <default>TRUE</default>
+      <locale name="C">
+        <short>Enable gdu plugin</short>
+        <long>Set to True to enable the gdu (gnome-disk-utility) plugin, to show important events from DeviceKit-disks daemon.</long>
+      </locale>
+    </schema>
+    <schema>
+      <key>/schemas/apps/gnome_settings_daemon/plugins/gdu/priority</key>
+      <applyto>/apps/gnome_settings_daemon/plugins/gdu/priority</applyto>
+      <owner>gnome-settings-daemon</owner>
+      <type>int</type>
+      <default>300</default>
+      <locale name="C">
+        <short></short>
+        <long></long>
+      </locale>
+    </schema>
+
+    <schema>
       <key>/schemas/apps/gnome_settings_daemon/plugins/housekeeping/active</key>
       <applyto>/apps/gnome_settings_daemon/plugins/housekeeping/active</applyto>
       <owner>gnome-settings-daemon</owner>
Index: po/POTFILES.in
===================================================================
--- po/POTFILES.in	(revision 767)
+++ po/POTFILES.in	(working copy)
@@ -37,3 +37,4 @@
 [type: gettext/ini]plugins/xrdb/xrdb.gnome-settings-plugin.in
 plugins/xsettings/gsd-xsettings-manager.c
 [type: gettext/ini]plugins/xsettings/xsettings.gnome-settings-plugin.in
+plugins/gdu/gsd-gdu-manager.c
