diff options
Diffstat (limited to 'src/comet.c')
| -rw-r--r-- | src/comet.c | 20 |
1 files changed, 13 insertions, 7 deletions
diff --git a/src/comet.c b/src/comet.c index e87836e..be76621 100644 --- a/src/comet.c +++ b/src/comet.c @@ -6,6 +6,7 @@ #include "layout.h" #include "util.h" #include "event.h" +#include "config.h" #define ANY_LOG_IMPLEMENT #define ANY_LOG_VALUE_STRING(key, value) "%s=\"%s\"", key, value ? value : "(null)" @@ -38,6 +39,11 @@ int main(int argc, char **argv) setlocale(LC_CTYPE, ""); any_log_init(stdout, ANY_LOG_DEBUG); + FILE *config_file = fopen("comet.conf", "rb"); + + config_t config; + config_init(&config, config_file); + display_t display; display_init(&display); @@ -47,8 +53,8 @@ int main(int argc, char **argv) int x_padding = 10; int y_padding = 8; - int height = 30; - int width = display.screen_size->width - 2 * x_padding; + //int height = 30; + //int width = display.screen_size->width - 2 * x_padding; const char *font = "Hack 12"; log_debug("Loading font '%s'", font); @@ -57,11 +63,11 @@ int main(int argc, char **argv) .fontdesc = pango_font_description_from_string(font), .context = pango_cairo_create_context(window.cr), .x_offset = 0, - .height = height, - .width = width, + .height = config.height, + .width = config.width, }; - window_resize(&window, width, height); + window_resize(&window, config.width, config.height); window_move(&window, x_padding, y_padding); block_t blocks[2] = { @@ -87,7 +93,7 @@ int main(int argc, char **argv) block_t top = { .hidden = false, .color = { 0.3, 0.2, 0.5, 1 }, - .min_width = width, + .min_width = config.width, .type = BLOCK_GROUP, .group = { .spacing = 10, @@ -114,7 +120,7 @@ int main(int argc, char **argv) event_dispatch(&display, &layout); cairo_surface_t *surface = render(&layout, info); - window_present(&window, surface, width, height); + window_present(&window, surface, config.width, config.height); cairo_surface_destroy(surface); layout_free(&layout); |
