diff -ruN metacity-2.12.2.orig/configure.in metacity-2.12.2/configure.in
--- metacity-2.12.2.orig/configure.in	Mon Oct  3 20:35:55 2005
+++ metacity-2.12.2/configure.in	Wed Nov 30 18:12:50 2005
@@ -113,6 +113,18 @@
     METACITY_PC_MODULES="$METACITY_PC_MODULES gconf-2.0 >= 1.2.0"
 fi
 
+AC_ARG_ENABLE(libgnome,
+  AC_HELP_STRING([--disable-libgnome],
+                 [disable libgnome usage, for embedded/size-sensitive non-GNOME builds]),,
+  enable_libgnome=yes)
+
+if test x$enable_libgnome = xyes; then
+    AC_DEFINE(HAVE_LIBGNOME,1,[Build with libgnome support])
+    METACITY_PC_MODULES="$METACITY_PC_MODULES libgnome-2.0"
+fi
+
+AM_CONDITIONAL(HAVE_LIBGNOME, test "$enable_libgnome" = "yes")
+
 AC_ARG_ENABLE(verbose-mode,
   AC_HELP_STRING([--disable-verbose],
                  [disable metacity's ability to do verbose logging, for embedded/size-sensitive custom builds]),,
@@ -506,6 +518,7 @@
 	compiler:		  ${CC}
 
 	GConf:                    ${enable_gconf}
+	libgnome:                 ${enable_libgnome}
 	XFree86 Xinerama:         ${use_xfree_xinerama}
 	Solaris Xinerama:         ${use_solaris_xinerama}
 	Startup notification:     ${have_startup_notification}
diff -ruN metacity-2.12.2.orig/po/POTFILES.in metacity-2.12.2/po/POTFILES.in
--- metacity-2.12.2.orig/po/POTFILES.in	Mon Dec 20 03:41:22 2004
+++ metacity-2.12.2/po/POTFILES.in	Wed Nov 30 18:04:26 2005
@@ -1,6 +1,7 @@
 # List of source files containing translatable strings.
 # Please keep this file sorted alphabetically.
 src/tools/metacity-message.c
+src/bell.c
 src/delete.c
 src/display.c
 src/errors.c
@@ -12,6 +13,7 @@
 src/metacity-dialog.c
 src/metacity.desktop.in
 src/metacity.schemas.in
+src/metacity.soundlist.in
 src/prefs.c
 src/resizepopup.c
 src/screen.c
diff -ruN metacity-2.12.2.orig/src/Makefile.am metacity-2.12.2/src/Makefile.am
--- metacity-2.12.2.orig/src/Makefile.am	Tue Jan  4 00:50:10 2005
+++ metacity-2.12.2/src/Makefile.am	Wed Nov 30 18:04:26 2005
@@ -2,7 +2,7 @@
 
 SUBDIRS=wm-tester tools themes
 
-INCLUDES=@METACITY_CFLAGS@ -DMETACITY_LIBEXECDIR=\"$(libexecdir)\" -DMETACITY_LIBDIR=\"$(libdir)\" -DHOST_ALIAS=\"@HOST_ALIAS@\" -DMETACITY_LOCALEDIR=\"$(prefix)/@DATADIRNAME@/locale\" -DMETACITY_PKGDATADIR=\"$(pkgdatadir)\" -DMETACITY_DATADIR=\"$(datadir)\" -DG_LOG_DOMAIN=\"metacity\" -DSN_API_NOT_YET_FROZEN=1
+INCLUDES=@METACITY_CFLAGS@ -DMETACITY_PREFIX=\"$(prefix)\" -DMETACITY_SYSCONFDIR="\"$(sysconfdir)\"" -DMETACITY_LIBEXECDIR=\"$(libexecdir)\" -DMETACITY_LIBDIR=\"$(libdir)\" -DHOST_ALIAS=\"@HOST_ALIAS@\" -DMETACITY_LOCALEDIR=\"$(prefix)/@DATADIRNAME@/locale\" -DMETACITY_PKGDATADIR=\"$(pkgdatadir)\" -DMETACITY_DATADIR=\"$(datadir)\" -DG_LOG_DOMAIN=\"metacity\" -DSN_API_NOT_YET_FROZEN=1
 
 EGGFILES=			\
 	eggaccelerators.c	\
@@ -146,6 +146,13 @@
 desktopfiles_files=$(desktopfiles_in_files:.desktop.in=.desktop)
 desktopfiles_DATA = $(desktopfiles_files)
 @INTLTOOL_DESKTOP_RULE@
+
+if HAVE_LIBGNOME
+soundlistdir = $(sysconfdir)/sound/events
+soundlist_in_files = metacity.soundlist.in
+soundlist_DATA = metacity.soundlist
+@INTLTOOL_SOUNDLIST_RULE@
+endif
 
 schemadir   = @GCONF_SCHEMA_FILE_DIR@
 schema_in_files = metacity.schemas.in
diff -ruN metacity-2.12.2.orig/src/bell.c metacity-2.12.2/src/bell.c
--- metacity-2.12.2.orig/src/bell.c	Mon Oct  3 21:22:40 2005
+++ metacity-2.12.2/src/bell.c	Wed Nov 30 18:04:26 2005
@@ -24,6 +24,13 @@
 #include "screen.h"
 #include "prefs.h"
 
+#ifdef HAVE_LIBGNOME
+#include <libgnome/libgnome.h>
+#include <libintl.h>
+#define _(x) dgettext (GETTEXT_PACKAGE, x)
+#define N_(x) x
+#endif
+
 static void
 meta_bell_flash_screen (MetaDisplay *display, 
 			MetaScreen  *screen)
@@ -180,6 +187,10 @@
   /* flash something */
   if (meta_prefs_get_visual_bell ()) 
     meta_bell_visual_notify (display, xkb_ev);
+#ifdef HAVE_LIBGNOME
+  /* emit an event */
+  gnome_triggers_do(_("System bell"), NULL, "metacity", "system-bell", NULL);
+#endif
 }
 #endif
 
diff -ruN metacity-2.12.2.orig/src/main.c metacity-2.12.2/src/main.c
--- metacity-2.12.2.orig/src/main.c	Tue Jul 12 22:54:34 2005
+++ metacity-2.12.2/src/main.c	Wed Nov 30 18:26:48 2005
@@ -33,6 +33,9 @@
 #ifdef HAVE_GCONF
 #include <gconf/gconf-client.h>
 #endif
+#ifdef HAVE_LIBGNOME
+#include <libgnome/libgnome.h>
+#endif
 
 
 #include <stdlib.h>
@@ -362,6 +365,19 @@
   bindtextdomain (GETTEXT_PACKAGE, METACITY_LOCALEDIR);
   bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8");
   textdomain (GETTEXT_PACKAGE);
+
+#ifdef HAVE_LIBGNOME
+  gnome_program_init(PACKAGE,
+		     VERSION,
+		     LIBGNOME_MODULE,
+		     1,		/* do not let GNOME parse argv */
+		     argv,
+		     GNOME_PARAM_APP_PREFIX, METACITY_PREFIX,
+		     GNOME_PARAM_APP_SYSCONFDIR, METACITY_SYSCONFDIR,
+		     GNOME_PARAM_APP_DATADIR, METACITY_DATADIR,
+		     GNOME_PARAM_APP_LIBDIR, METACITY_LIBDIR,
+		     NULL);
+#endif
 
   /* Parse command line arguments.*/
   meta_parse_options (&argc, &argv, &meta_args);
diff -ruN metacity-2.12.2.orig/src/metacity.soundlist.in metacity-2.12.2/src/metacity.soundlist.in
--- metacity-2.12.2.orig/src/metacity.soundlist.in	Thu Jan  1 01:00:00 1970
+++ metacity-2.12.2/src/metacity.soundlist.in	Wed Nov 30 18:04:26 2005
@@ -0,0 +1,6 @@
+[__section_info__]
+_description=Window manager
+
+[system-bell]
+file=generic.wav
+_description=System bell
