diff -Nur gnome-screensaver-2.14.1/src/gs-listener-dbus.c gnome-screensaver-2.14.1.new/src/gs-listener-dbus.c
--- gnome-screensaver-2.14.1/src/gs-listener-dbus.c	2006-03-14 21:33:20.000000000 +0100
+++ gnome-screensaver-2.14.1.new/src/gs-listener-dbus.c	2006-04-10 21:38:23.000000000 +0200
@@ -60,11 +60,14 @@
 
 #define TYPE_MISMATCH_ERROR GS_LISTENER_INTERFACE ".TypeMismatch"
 
+#define DBUS_INTERFACE_HAL "org.freedesktop.Hal.Device"
+
 #define GS_LISTENER_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), GS_TYPE_LISTENER, GSListenerPrivate))
 
 struct GSListenerPrivate
 {
         DBusConnection *connection;
+        DBusConnection *system_connection;
 
         guint           session_idle : 1;
         guint           active : 1;
@@ -951,21 +954,38 @@
         DBusError error;
 
         dbus_error_init (&error);
+        
+        if (listener->priv->connection == NULL) {
+                listener->priv->connection = dbus_bus_get (DBUS_BUS_SESSION, &error);
 
-        listener->priv->connection = dbus_bus_get (DBUS_BUS_SESSION, &error);
+                if (listener->priv->connection == NULL) {
+                        if (dbus_error_is_set (&error)) {
+                                g_warning ("couldn't connect to session bus: %s",
+                                           error.message);
+                                dbus_error_free (&error);
+                        }
+                        return FALSE;
+                }
 
-        if (listener->priv->connection == NULL) {
-                if (dbus_error_is_set (&error)) {
-                        g_warning ("couldn't connect to session bus: %s",
-                                   error.message);
-                        dbus_error_free (&error);
+                dbus_connection_setup_with_g_main (listener->priv->connection, NULL);
+                dbus_connection_set_exit_on_disconnect (listener->priv->connection, FALSE);
+        }
+        
+        if (listener->priv->system_connection == NULL) {
+                listener->priv->system_connection = dbus_bus_get (DBUS_BUS_SYSTEM, &error);
+                if (listener->priv->system_connection == NULL) {
+                        if (dbus_error_is_set (&error)) {
+                                g_warning ("couldn't connect to session bus: %s",
+                                           error.message);
+                                dbus_error_free (&error);
+                        }
+                        return FALSE;
                 }
-                return FALSE;
+                
+                dbus_connection_setup_with_g_main (listener->priv->system_connection, NULL);
+                dbus_connection_set_exit_on_disconnect (listener->priv->system_connection, FALSE);
         }
-
-        dbus_connection_setup_with_g_main (listener->priv->connection, NULL);
-	dbus_connection_set_exit_on_disconnect (listener->priv->connection, FALSE);
-
+        
         return TRUE;
 }
 
@@ -1007,11 +1027,11 @@
         if (dbus_message_is_signal (message, DBUS_INTERFACE_LOCAL, "Disconnected") &&
             strcmp (path, DBUS_PATH_LOCAL) == 0) {
 
-                g_message ("Got disconnected from the system message bus; "
+                g_message ("Got disconnected from the session message bus; "
                            "retrying to reconnect every 10 seconds");
 
                 dbus_connection_unref (connection);
-                connection = NULL;
+                listener->priv->connection = NULL;
 
                 g_timeout_add (10000, (GSourceFunc)reinit_dbus, listener);
         } else if (dbus_message_is_signal (message,
@@ -1027,6 +1047,48 @@
         return DBUS_HANDLER_RESULT_HANDLED;
 }
 
+static DBusHandlerResult
+listener_dbus_system_filter_function (DBusConnection *connection,
+                                      DBusMessage    *message,
+                                      void           *user_data)
+{
+        GSListener *listener = GS_LISTENER (user_data);
+        const char *path = dbus_message_get_path (message);
+        
+        if (dbus_message_is_signal (message,
+                                    DBUS_INTERFACE_HAL,
+                                    "Condition")) {
+                DBusError error;
+                char *event;
+                char *keyname;
+                if (dbus_message_get_args (message, &error,
+                                           DBUS_TYPE_STRING, &event,
+                                           DBUS_TYPE_STRING, &keyname,
+                                           DBUS_TYPE_INVALID)) {
+                        if ((event && strcmp (event, "ButtonPressed") == 0) &&
+                            (keyname && strcmp (keyname, "coffee") == 0)) {
+                                g_signal_emit (listener, signals [LOCK], 0);
+                        }
+                }
+                if (dbus_error_is_set (&error))
+                        dbus_error_free (&error);
+
+        } else if (dbus_message_is_signal (message,
+                                           DBUS_INTERFACE_LOCAL,
+                                           "Disconnected")
+                   && strcmp (path, DBUS_PATH_LOCAL) == 0) {
+                g_message ("Got disconnected from the system message bus; "
+                           "retrying to reconnect every 10 seconds");
+
+                dbus_connection_unref (connection);
+                listener->priv->system_connection = NULL;
+
+                g_timeout_add (10000, (GSourceFunc)reinit_dbus, listener);
+        }
+        
+        return DBUS_HANDLER_RESULT_HANDLED;
+}
+
 static void
 gs_listener_set_property (GObject            *object,
                           guint               prop_id,
@@ -1272,7 +1334,15 @@
                             ",sender='"DBUS_SERVICE_DBUS"'"
                             ",member='NameOwnerChanged'",
                             NULL);
-
+        
+        dbus_connection_add_filter (listener->priv->system_connection, listener_dbus_system_filter_function, listener, NULL);
+        
+        dbus_bus_add_match (listener->priv->system_connection,
+                            "type='signal'"
+                            ",interface='"DBUS_INTERFACE_HAL"'"
+                            ",member='Condition'",
+                            NULL);
+        
         return acquired;
 }
 
@@ -1280,7 +1350,8 @@
 gs_listener_init (GSListener *listener)
 {
         listener->priv = GS_LISTENER_GET_PRIVATE (listener);
-
+        listener->priv->connection = listener->priv->system_connection = NULL;
+        
         gs_listener_dbus_init (listener);
 }
 
