## 4. Theming
-Themes are located at `~/.local/share/themes/\<theme-name\>/openbox-3/` or
+Themes are located at `~/.local/share/themes/\<theme-name\>/labwc/` or
equivalent `XDG_DATA_{DIRS,HOME}` location in accordance with freedesktop XDG
directory specification.
The theme engine aims to be compatible with openbox and themes will be
searched for in the following order:
+- ${XDG_DATA_HOME:-$HOME/.local/share}/themes/<theme-name>/labwc/
+- $HOME/.themes/<theme-name>/labwc/
+- /usr/share/themes/<theme-name>/labwc/
+- /usr/local/share/themes/<theme-name>/labwc/
+- /opt/share/themes/<theme-name>/labwc/
- ${XDG_DATA_HOME:-$HOME/.local/share}/themes/<theme-name>/openbox-3/
- $HOME/.themes/<theme-name>/openbox-3/
- /usr/share/themes/<theme-name>/openbox-3/
* theme_init - read openbox theme and generate button textures
* @theme: theme data
* @server: server
- * @theme_name: theme-name in <theme-dir>/<theme-name>/openbox-3/themerc
+ * @theme_name: theme-name in <theme-dir>/<theme-name>/labwc/themerc
* Note <theme-dir> is obtained in theme-dir.c
*/
void theme_init(struct theme *theme, struct server *server, const char *theme_name);
}
static void
-build_theme_path(struct ctx *ctx, char *prefix, const char *path)
+build_theme_path_labwc(struct ctx *ctx, char *prefix, const char *path)
+{
+ assert(prefix);
+ snprintf(ctx->buf, ctx->len, "%s/%s/%s/labwc/%s", prefix, path,
+ ctx->theme_name, ctx->filename);
+}
+
+static void
+build_theme_path_openbox(struct ctx *ctx, char *prefix, const char *path)
{
assert(prefix);
snprintf(ctx->buf, ctx->len, "%s/%s/%s/openbox-3/%s", prefix, path,
static char buf[4096] = { 0 };
wl_list_init(paths);
struct ctx ctx = {
- .build_path_fn = build_theme_path,
+ .build_path_fn = build_theme_path_labwc,
.filename = filename,
.buf = buf,
.len = sizeof(buf),
.list = paths,
};
find_dir(&ctx);
+
+ ctx.build_path_fn = build_theme_path_openbox;
+ find_dir(&ctx);
}
void
*/
theme_builtin(theme, server);
- /* Read <data-dir>/share/themes/$theme_name/openbox-3/themerc */
+ /*
+ * Read
+ * - <data-dir>/share/themes/$theme_name/labwc/themerc
+ * - <data-dir>/share/themes/$theme_name/openbox-3/themerc
+ */
struct wl_list paths;
paths_theme_create(&paths, theme_name, "themerc");
theme_read(theme, &paths);