1 diff -aurN fbpanel-4.1.orig/panel.c fbpanel-4.1/panel.c
2 --- fbpanel-4.1.orig/panel.c 2004-12-23 18:26:05.000000000 +0100
3 +++ fbpanel-4.1/panel.c 2005-05-02 18:56:09.000000000 +0200
15 static gchar *cfgfile = NULL;
16 +time_t last_config_poll = 0;
18 +/* Array of config files to watch */
19 +GArray *config_files = NULL;
21 static gchar version[] = VERSION;
22 gchar *cprofile = "default";
25 panel_configure_event (GtkWidget *widget, GdkEventConfigure *e, panel *p)
29 + if ((time(NULL) - last_config_poll) > 10)
32 + struct stat cfgstat;
35 + for (i = 0; i < config_files->len; i++)
37 + f = g_array_index(config_files, watched_file, i);
38 + stat(f.filename, &cfgstat);
39 + if (cfgstat.st_mtime > f.mtime)
45 + last_config_poll = time(NULL);
48 if (e->width == p->cw && e->height == p->ch && e->x == p->cx && e->y == p->cy)
53 fname = g_strdup_printf("%s/.fbpanel/%s", getenv("HOME"), profile);
54 if ((fp = fopen(fname, "r"))) {
57 + f.mtime = time(NULL);
58 + g_array_append_val(config_files, f);
61 ERR("Using %s\n", fname);
63 //ERR("Can't load %s\n", fname);
66 - /* check private configuration directory */
67 - fname = g_strdup_printf("%s/share/fbpanel/%s", PREFIX, profile);
68 + /* check system-wide configuration directory */
69 + fname = g_strdup_printf("/etc/fbpanel/%s", profile);
70 if ((fp = fopen(fname, "r"))) {
73 + f.mtime = time(NULL);
74 + g_array_append_val(config_files, f);
77 ERR("Using %s\n", fname);
81 ERR("starting panel\n");
86 + for (i = 0; i < config_files->len; i++)
88 + w = g_array_index(config_files, watched_file, i);
91 + g_array_free(config_files, TRUE);
93 + config_files = g_array_new(FALSE, FALSE, sizeof(watched_file));
95 if (!(pfp = open_profile(cprofile)))
98 diff -aurN fbpanel-4.1.orig/panel.h fbpanel-4.1/panel.h
99 --- fbpanel-4.1.orig/panel.h 2004-12-22 18:46:00.000000000 +0100
100 +++ fbpanel-4.1/panel.h 2005-05-02 18:56:09.000000000 +0200
103 extern command commands[];
110 +extern GArray *config_files;
112 extern gchar *cprofile;
114 extern Atom a_UTF8_STRING;
115 diff -aurN fbpanel-4.1.orig/plugin.c fbpanel-4.1/plugin.c
116 --- fbpanel-4.1.orig/plugin.c 2004-12-22 20:58:55.000000000 +0100
117 +++ fbpanel-4.1/plugin.c 2005-05-02 18:56:09.000000000 +0200
119 DBG("opening %s\n", str->str);
121 DBG("%s\n", g_module_error());
122 - g_string_printf(str, "%s/share/fbpanel/plugins/%s.so", PREFIX, type);
123 + g_string_printf(str, "%s/lib/fbpanel/plugins/%s.so", PREFIX, type);
124 m = g_module_open(str->str, G_MODULE_BIND_LOCAL | G_MODULE_BIND_LAZY);
125 DBG("opening %s\n", str->str);
127 diff -aurN fbpanel-4.1.orig/plugins/menu.c fbpanel-4.1/plugins/menu.c
128 --- fbpanel-4.1.orig/plugins/menu.c 2004-12-22 15:51:55.000000000 +0100
129 +++ fbpanel-4.1/plugins/menu.c 2005-05-02 19:02:01.000000000 +0200
133 if ((fi = fopen(name, "r"))) {
136 + f.mtime = time(NULL);
137 + g_array_append_val(config_files, f);
138 ERR("Including %s\n", name);
142 ERR("Can't include %s\n", name);
144 mi = read_submenu(p, 0);
145 //bg_set_transparent_background(mi, p->panel);
147 - ERR("menu: plugin init failde\n");
148 + ERR("menu: plugin init failed\n");
151 gtk_menu_shell_append (GTK_MENU_SHELL (m->mainw), mi);