Index: Makefile.am
===================================================================
--- Makefile.am	(revision d70f45f696c36079cd7f4d0487301f33cbd5e8bc)
+++ Makefile.am	(revision f3a9d4dd3ad1d729525546db7fbfbf0afebe551d)
@@ -56,5 +56,5 @@
 BASE_SRCS = $(CODELIST_SRCS) $(NORMAL_SRCS)
 
-GEN_C = varstubs.c perlglue.c
+GEN_C = varstubs.c perlglue.c globalnotifier.c
 GEN_H = owl_prototypes.h
 
@@ -76,4 +76,7 @@
 	$(AM_V_GEN)perl $< $(sort $(filter-out $<,$+)) > $@
 
+globalnotifier.c: globalnotifiergen.pl variable.c
+	$(AM_V_GEN)perl $< $(sort $(filter-out $<,$+)) > $@
+
 owl_prototypes.h.new: codelist.pl varstubs.c $(CODELIST_SRCS)
 	$(AM_V_GEN)perl $< $(sort $(filter-out $<,$+)) > $@
Index: globalnotifier.h
===================================================================
--- globalnotifier.h	(revision f3a9d4dd3ad1d729525546db7fbfbf0afebe551d)
+++ globalnotifier.h	(revision f3a9d4dd3ad1d729525546db7fbfbf0afebe551d)
@@ -0,0 +1,43 @@
+#ifndef __BARNOWL_GLOBAL_NOTIFIER_H__
+#define __BARNOWL_GLOBAL_NOTIFIER_H__
+
+#include <glib-object.h>
+#include "owl.h"
+
+G_BEGIN_DECLS
+
+#define OWL_TYPE_GLOBAL_NOTIFIER owl_global_notifier_get_type()
+
+#define OWL_GLOBAL_NOTIFIER(obj) \
+    (G_TYPE_CHECK_INSTANCE_CAST ((obj), OWL_TYPE_GLOBAL_NOTIFIER, OwlGlobalNotifier))
+
+#define OWL_GLOBAL_NOTIFIER_CLASS(klass) \
+    (G_TYPE_CHECK_CLASS_CAST ((klass), OWL_TYPE_GLOBAL_NOTIFIER, OwlGlobalNotifierClass))
+
+#define OWL_IS_GLOBAL_NOTIFIER(obj) \
+    (G_TYPE_CHECK_INSTANCE_TYPE ((obj), OWL_TYPE_GLOBAL_NOTIFIER))
+
+#define OWL_IS_GLOBAL_NOTIFIER_CLASS(klass) \
+    (G_TYPE_CHECK_CLASS_TYPE ((klass), OWL_TYPE_GLOBAL_NOTIFIER))
+
+#define OWL_GLOBAL_NOTIFIER_GET_CLASS(obj) \
+    (G_TYPE_INSTANCE_GET_CLASS ((obj), OWL_TYPE_GLOBAL_NOTIFIER, OwlGlobalNotifierClass))
+
+typedef struct _OwlGlobalNotifierClass OwlGlobalNotifierClass;
+
+struct _OwlGlobalNotifier {
+    GObject parent;
+    owl_global *g;
+};
+
+struct _OwlGlobalNotifierClass {
+    GObjectClass parent_class;
+};
+
+GType owl_global_notifier_get_type (void);
+
+OwlGlobalNotifier* owl_global_notifier_new(owl_global *g);
+
+G_END_DECLS
+
+#endif /* __BARNOWL_GLOBAL_NOTIFIER_H__ */
Index: globalnotifiergen.pl
===================================================================
--- globalnotifiergen.pl	(revision f3a9d4dd3ad1d729525546db7fbfbf0afebe551d)
+++ globalnotifiergen.pl	(revision f3a9d4dd3ad1d729525546db7fbfbf0afebe551d)
@@ -0,0 +1,200 @@
+print qq(/* THIS FILE WAS AUTOGENERATED BY GLOBALNOTIFIERGEN.PL --- DO NOT EDIT BY HAND!!! */\n\n);
+
+my @vars = ();
+foreach $file (@ARGV) {
+    open(FILE, $file);
+
+    while (<FILE>) {
+      if (m|^\s*OWLVAR_([A-Z_0-9]+)\s*\(\s*"([^"]+)"\s*/\*\s*%OwlVarStub:?([a-z0-9_]+)?\s*\*/|) {   # "
+        my $vartype = $1;
+        my $varname = $2;
+        my $altvarname = $2;
+        $altvarname = $3 if ($3);
+
+        my $propname = $altvarname;
+        $propname =~ tr/a-z/A-Z/;
+        $propname = "PROP_$propname";
+
+        my $detailname = $altvarname;
+        $detailname =~ s/[^a-zA-Z0-9]/-/g;
+
+        push @vars, {type => $vartype,
+                     name => $varname,
+                     altname => $altvarname,
+                     propname => $propname,
+                     detailname => $detailname};
+      }
+    }
+    close(FILE);
+}
+
+print <<EOT;
+#include "globalnotifier.h"
+#include "owl.h"
+
+/* properties */
+enum {
+  PROP_NONE,
+  /* normal properties */
+  PROP_RIGHTSHIFT,
+  /* generated from variable listings */
+EOT
+
+for my $var (@vars) {
+  print "  " . $var->{propname} . ",\n";
+}
+
+print <<EOT;
+};
+
+G_DEFINE_TYPE(OwlGlobalNotifier, owl_global_notifier, G_TYPE_OBJECT)
+
+static void owl_global_notifier_set_property(GObject *object,
+                                             guint property_id,
+                                             const GValue *value,
+                                             GParamSpec *pspec)
+{
+  OwlGlobalNotifier *notifier = OWL_GLOBAL_NOTIFIER(object);
+
+  switch (property_id) {
+    /* normal properties */
+    case PROP_RIGHTSHIFT:
+      owl_global_set_rightshift(notifier->g, g_value_get_int(value));
+      break;
+    /* generated from variable listings */
+EOT
+
+for my $var (@vars) {
+    my $varname = $var->{name};
+    my $propname = $var->{propname};
+    print "    case $propname:\n";
+
+    if ($var->{type} =~ /^BOOL/) {
+      print <<EOT;
+      if (g_value_get_boolean(value)) {
+        owl_variable_set_bool_on(&notifier->g->vars, "$varname");
+      } else {
+        owl_variable_set_bool_off(&notifier->g->vars, "$varname");
+      }
+EOT
+    } elsif ($var->{type} =~ /^PATH/ or $var->{type} =~ /^STRING/) {
+      print "      owl_variable_set_string(&notifier->g->vars, \"$varname\", g_value_get_string(value));\n";
+    } elsif ($var->{type} =~ /^INT/ or $var->{type} =~ /^ENUM/) {
+      print "      owl_variable_set_int(&notifier->g->vars, \"$varname\", g_value_get_int(value));\n";
+    } 
+    print "      break;\n";
+}
+
+print <<EOT;
+    default:
+      G_OBJECT_WARN_INVALID_PROPERTY_ID(object, property_id, pspec);
+  }
+}
+
+static void owl_global_notifier_get_property(GObject *object,
+                                             guint property_id,
+                                             GValue *value,
+                                             GParamSpec *pspec)
+{
+  OwlGlobalNotifier *notifier = OWL_GLOBAL_NOTIFIER(object);
+
+  switch (property_id) {
+    /* normal properties */
+    case PROP_RIGHTSHIFT:
+      g_value_set_int(value, owl_global_get_rightshift(notifier->g));
+      break;
+    /* generated from variable listings */
+EOT
+for my $var (@vars) {
+    my $varname = $var->{name};
+    my $propname = $var->{propname};
+    print "    case $propname:\n";
+
+    if ($var->{type} =~ /^BOOL/) {
+      print "      g_value_set_boolean(value, owl_variable_get_bool(&notifier->g->vars, \"$varname\"));\n";
+    } elsif ($var->{type} =~ /^PATH/ or $var->{type} =~ /^STRING/) {
+      print "      g_value_set_string(value, owl_variable_get_string(&notifier->g->vars, \"$varname\"));\n";
+    } elsif ($var->{type} =~ /^INT/ or $var->{type} =~ /^ENUM/) {
+      print "      g_value_set_int(value, owl_variable_get_int(&notifier->g->vars, \"$varname\"));\n";
+    } 
+    print "      break;\n";
+}
+print <<EOT;
+    default:
+      G_OBJECT_WARN_INVALID_PROPERTY_ID(object, property_id, pspec);
+  }
+}
+
+static void owl_global_notifier_class_init(OwlGlobalNotifierClass *klass)
+{
+  GObjectClass *gobject_class = G_OBJECT_CLASS(klass);
+  GParamSpec *pspec;
+
+  gobject_class->get_property = owl_global_notifier_get_property;
+  gobject_class->set_property = owl_global_notifier_set_property;
+
+  /* Register properties */
+  
+  pspec = g_param_spec_int("rightshift",
+                           "rightshift",
+                           "How much we shift to the right",
+                           0,
+                           INT_MAX,
+                           0,
+                           G_PARAM_READABLE|G_PARAM_WRITABLE
+                          |G_PARAM_STATIC_NAME|G_PARAM_STATIC_NICK|G_PARAM_STATIC_BLURB);
+  g_object_class_install_property(gobject_class, PROP_RIGHTSHIFT, pspec);
+
+EOT
+for my $var (@vars) {
+    my $varname = $var->{name};
+    my $propname = $var->{propname};
+    my $detailname = $var->{detailname};
+    if ($var->{type} =~ /^BOOL/) {
+      print <<EOT
+  pspec = g_param_spec_boolean("$detailname",
+                               "$varname",
+                               "$varname", /* TODO: parse out the summary too */
+                               FALSE,
+                               G_PARAM_READABLE|G_PARAM_WRITABLE
+                              |G_PARAM_STATIC_NAME|G_PARAM_STATIC_NICK|G_PARAM_STATIC_BLURB);
+EOT
+    } elsif ($var->{type} =~ /^PATH/ or $var->{type} =~ /^STRING/) {
+      print <<EOT
+  pspec = g_param_spec_string("$detailname",
+                              "$varname",
+                              "$varname", /* TODO: parse out the summary too */
+                              "",
+                              G_PARAM_READABLE|G_PARAM_WRITABLE
+                             |G_PARAM_STATIC_NAME|G_PARAM_STATIC_NICK|G_PARAM_STATIC_BLURB);
+EOT
+    } elsif ($var->{type} =~ /^INT/ or $var->{type} =~ /^ENUM/) {
+      print <<EOT
+  pspec = g_param_spec_int("$detailname",
+                           "$varname",
+                           "$varname", /* TODO: parse out the summary too */
+                           INT_MIN,
+                           INT_MAX,
+                           0,
+                           G_PARAM_READABLE|G_PARAM_WRITABLE
+                          |G_PARAM_STATIC_NAME|G_PARAM_STATIC_NICK|G_PARAM_STATIC_BLURB);
+EOT
+    } 
+    print "  g_object_class_install_property(gobject_class, $propname, pspec);\n\n";
+}
+print <<EOT;
+}
+
+static void owl_global_notifier_init(OwlGlobalNotifier *self)
+{
+}
+
+OwlGlobalNotifier *owl_global_notifier_new(owl_global *g)
+{
+  OwlGlobalNotifier *gn;
+  
+  gn = g_object_new(OWL_TYPE_GLOBAL_NOTIFIER, NULL);
+  gn->g = g;
+  return gn;
+}
+EOT
Index: owl.h
===================================================================
--- owl.h	(revision d70f45f696c36079cd7f4d0487301f33cbd5e8bc)
+++ owl.h	(revision f3a9d4dd3ad1d729525546db7fbfbf0afebe551d)
@@ -561,5 +561,8 @@
 } owl_popexec;
 
+typedef struct _OwlGlobalNotifier OwlGlobalNotifier;
+
 typedef struct _owl_global {
+  OwlGlobalNotifier *gn;
   owl_mainwin mw;
   owl_popwin pw;
