+// theme file management
+void read_config()
+{
+ char *path;
+
+ if (g_default_theme)
+ g_free(g_default_theme);
+
+ g_width = 600;
+ g_height = 350;
+ path = g_build_filename (g_get_user_config_dir(), "tint2", "tint2confrc", NULL);
+ if (g_file_test (path, G_FILE_TEST_EXISTS)) {
+ FILE *fp;
+ char line[80];
+ char *key, *value;
+ if ((fp = fopen(path, "r")) != NULL) {
+ while (fgets(line, sizeof(line), fp) != NULL) {
+ if (parse_line(line, &key, &value)) {
+ if (strcmp (key, "default_theme") == 0)
+ g_default_theme = strdup (value);
+ else if (strcmp (key, "width") == 0)
+ g_width = atoi(value);
+ else if (strcmp (key, "height") == 0)
+ g_height = atoi(value);
+ free (key);
+ free (value);
+ }
+ }
+ fclose (fp);
+ }
+ }
+ g_free(path);
+}
+