struct theme theme = { 0 };
static const char labwc_usage[] =
-"Usage: labwc [-h] [-s <startup-command>] [-c <config-file>]\n";
+ "Usage: labwc [-h] [-s <startup-command>] [-c <config-file>]\n";
static void usage(void)
{
server_init(&server);
server_start(&server);
- theme_read("data/themerc");
+ theme_read(rc.theme_name);
xbm_load(server.renderer);
if (startup_cmd)
#include <ctype.h>
#include "theme.h"
+#include "theme/theme-dir.h"
static int hex_to_dec(char c)
{
entry(key, value);
}
-void theme_read(const char *filename)
+void theme_read(const char *theme_name)
{
FILE *stream;
char *line = NULL;
size_t len = 0;
+ char themerc[4096];
- stream = fopen(filename, "r");
+ snprintf(themerc, sizeof(themerc), "%s/themerc", theme_dir(theme_name));
+ fprintf(stderr, "info: read themerc (%s)\n", themerc);
+ stream = fopen(themerc, "r");
if (!stream) {
- fprintf(stderr, "warn: cannot read '%s'\n", filename);
+ fprintf(stderr, "warn: cannot read (%s)\n", themerc);
return;
}
while (getline(&line, &len, stream) != -1) {