/* Color codes are stored here */
struct config_client {
+ uint32_t background;
struct Colortriple focused;
struct Colortriple focused_inactive;
struct Colortriple unfocused;
cols { /* yylval.number = STACK_LIMIT_COLS; */return TOKSTACKLIMIT; }
rows { /* yylval.number = STACK_LIMIT_ROWS; */return TOKSTACKLIMIT; }
exec { BEGIN(BIND_AWS_COND); return TOKEXEC; }
+client.background { BEGIN(COLOR_COND); yylval.single_color = &config.client.background; return TOKSINGLECOLOR; }
client.focused { BEGIN(COLOR_COND); yylval.color = &config.client.focused; return TOKCOLOR; }
client.focused_inactive { BEGIN(COLOR_COND); yylval.color = &config.client.focused_inactive; return TOKCOLOR; }
client.unfocused { BEGIN(COLOR_COND); yylval.color = &config.client.unfocused; return TOKCOLOR; }
%union {
int number;
char *string;
+ uint32_t *single_color;
struct Colortriple *color;
struct Assignment *assignment;
struct Binding *binding;
%token TOKSET
%token TOKIPCSOCKET "ipc_socket"
%token TOKEXEC "exec"
+%token TOKSINGLECOLOR
%token TOKCOLOR
%token TOKARROW "→"
%token TOKMODE "mode"
| assign
| ipcsocket
| exec
+ | single_color
| color
| terminal
| font
}
;
+single_color:
+ TOKSINGLECOLOR WHITESPACE colorpixel
+ {
+ uint32_t *dest = $<single_color>1;
+ *dest = $<number>3;
+ }
+ ;
color:
TOKCOLOR WHITESPACE colorpixel WHITESPACE colorpixel WHITESPACE colorpixel
/* TODO: remove window coloring after test-phase */
LOG("color %s\n", colors[cnt]);
new->name = strdup(colors[cnt]);
+#if 0
uint32_t cp = get_colorpixel(colors[cnt]);
cnt++;
if ((cnt % (sizeof(colors) / sizeof(char*))) == 0)
cnt = 0;
+#endif
x_con_init(new);
- xcb_change_window_attributes(conn, new->frame, XCB_CW_BACK_PIXEL, &cp);
+ // TODO: this needs to be integrated into src/x.c and updated on config file reloads
+ xcb_change_window_attributes(conn, new->frame, XCB_CW_BACK_PIXEL, &config.client.background);
TAILQ_INIT(&(new->floating_head));
TAILQ_INIT(&(new->nodes_head));
x.text = get_colorpixel(ctext); \
} while (0)
+ config.client.background = get_colorpixel("#000000");
INIT_COLOR(config.client.focused, "#4c7899", "#285577", "#ffffff");
INIT_COLOR(config.client.focused_inactive, "#333333", "#5f676a", "#ffffff");
INIT_COLOR(config.client.unfocused, "#333333", "#222222", "#888888");