2 #define I3__FILE__ "config_directives.c"
4 * vim:ts=4:sw=4:expandtab
6 * i3 - an improved dynamic tiling window manager
7 * © 2009-2012 Michael Stapelberg and contributors (see also: LICENSE)
9 * config_directives.c: all command functions (see config_parser.c)
17 // Macros to make the YAJL API a bit easier to use.
18 #define y(x, ...) yajl_gen_ ## x (cmd_output->json_gen, ##__VA_ARGS__)
19 #define ystr(str) yajl_gen_string(cmd_output->json_gen, (unsigned char*)str, strlen(str))
20 #define ysuccess(success) do { \
27 static char *font_pattern;
29 void cfg_font(I3_CFG, const char *font) {
30 config.font = load_font(font, true);
31 set_font(&config.font);
33 /* Save the font pattern for using it as bar font later on */
35 font_pattern = sstrdup(font);
38 void cfg_mode_binding(I3_CFG, const char *bindtype, const char *modifiers, const char *key, const char *command) {
39 printf("cfg_mode_binding: got bindtype\n");
42 void cfg_enter_mode(I3_CFG, const char *mode) {
43 // TODO: error handling: if mode == '{', the mode name is missing
44 printf("mode name: %s\n", mode);
47 void cfg_exec(I3_CFG, const char *exectype, const char *no_startup_id, const char *command) {
48 struct Autostart *new = smalloc(sizeof(struct Autostart));
49 new->command = sstrdup(command);
50 new->no_startup_id = (no_startup_id != NULL);
51 if (strcmp(exectype, "exec") == 0) {
52 TAILQ_INSERT_TAIL(&autostarts, new, autostarts);
54 TAILQ_INSERT_TAIL(&autostarts_always, new, autostarts_always);