Add theme.c to parse openbox's themerc

This commit is contained in:
Johan Malm 2020-06-11 21:20:43 +01:00
parent 0ede4c61e6
commit d40445da1d
10 changed files with 146 additions and 2 deletions

1
tools/theme/.gitignore vendored Normal file
View file

@ -0,0 +1 @@
theme-helper

8
tools/theme/Makefile Normal file
View file

@ -0,0 +1,8 @@
CFLAGS = -g -Wall -Wextra -pedantic -std=c11
CFLAGS += -I../../include/
ASAN_FLAGS = -O0 -fsanitize=address -fno-common -fno-omit-frame-pointer -rdynamic
CFLAGS += $(ASAN_FLAGS)
LDFLAGS += $(ASAN_FLAGS) -fuse-ld=gold
all:
gcc $(CFLAGS) -o theme-helper theme-helper.c ../../src/theme/theme.c $(LDFLAGS)

View file

@ -0,0 +1,14 @@
#include <stdio.h>
#include <stdlib.h>
#include "../../include/theme.h"
struct theme theme = { 0 };
int main()
{
theme_read("../../data/themerc");
for (int i=0; i < 4; i++)
printf("%.2f; ", theme.window_active_title_bg_color[i]);
printf("\n");
}