summaryrefslogtreecommitdiff
path: root/render/theme.c
diff options
context:
space:
mode:
authorDana Jansens <danakj@orodu.net>2003-09-15 19:20:05 +0000
committerDana Jansens <danakj@orodu.net>2003-09-15 19:20:05 +0000
commitc1b2fc5324522f74a14a5cfa210c95e1509a6e7f (patch)
tree7024fd9c49d64e29d3f622250199c5d6a382b721 /render/theme.c
parent3a607fad9df628ab16e0f7436dfbfc9b22634003 (diff)
make openbox base-dir spec compliant, and change the theme dir structure, so that themes go in $XDG_DATA_DIRS/themes/ with gtk/metacity/whateverelse themes
Diffstat (limited to 'render/theme.c')
-rw-r--r--render/theme.c29
1 files changed, 19 insertions, 10 deletions
diff --git a/render/theme.c b/render/theme.c
index 907fd0b5..8ad8c841 100644
--- a/render/theme.c
+++ b/render/theme.c
@@ -4,6 +4,7 @@
#include "mask.h"
#include "theme.h"
#include "icon.h"
+#include "parser/parse.h"
#include <X11/Xlib.h>
#include <X11/Xresource.h>
@@ -1059,21 +1060,29 @@ void RrThemeFree(RrTheme *theme)
static XrmDatabase loaddb(RrTheme *theme, char *name)
{
- XrmDatabase db;
+ GSList *it;
+ XrmDatabase db = NULL;
+ gchar *s;
- char *s = g_build_filename(g_get_home_dir(), ".openbox", "themes",
- name, "themerc", NULL);
- if ((db = XrmGetFileDatabase(s)))
- theme->path = g_path_get_dirname(s);
- g_free(s);
- if (db == NULL) {
- char *s = g_build_filename(THEMEDIR, name, "themerc", NULL);
+ if (name[0] == '/') {
+ s = g_build_filename(name, "openbox-3", "themerc", NULL);
if ((db = XrmGetFileDatabase(s)))
theme->path = g_path_get_dirname(s);
- g_free(s);
+ g_free(s);
+ } else {
+ for (it = parse_xdg_data_dir_paths(); !db && it;
+ it = g_slist_next(it))
+ {
+ s = g_build_filename(it->data, "themes", name,
+ "openbox-3", "themerc", NULL);
+ if ((db = XrmGetFileDatabase(s)))
+ theme->path = g_path_get_dirname(s);
+ g_free(s);
+ }
}
+
if (db == NULL) {
- char *s = g_build_filename(name, "themerc", NULL);
+ s = g_build_filename(name, "themerc", NULL);
if ((db = XrmGetFileDatabase(s)))
theme->path = g_path_get_dirname(s);
g_free(s);