From: Axel Wagner Date: Mon, 26 Jul 2010 17:55:02 +0000 (+0200) Subject: Print the workspace-names X-Git-Tag: 4.0.1~7^2~105 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=0f4164dd0f0ae2f44b504d86c37784bf60647cbf;p=i3%2Fi3 Print the workspace-names --- diff --git a/i3bar/src/xcb.c b/i3bar/src/xcb.c index fbfc02ad..fdd7dc15 100644 --- a/i3bar/src/xcb.c +++ b/i3bar/src/xcb.c @@ -117,6 +117,16 @@ void draw_buttons() { printf("Drawing Buttons...\n"); i3_output *outputs_walk = outputs; int i = 0; + xcb_font_t button_font = xcb_generate_id(xcb_connection); + char *fontname = "-misc-fixed-medium-r-semicondensed--12-110-75-75-c-60-iso10646-1"; + xcb_open_font(xcb_connection, + button_font, + strlen(fontname), + fontname); + xcb_change_gc(xcb_connection, + outputs_walk->bargc, + XCB_GC_FONT, + &button_font); while (outputs_walk != NULL) { if (!outputs_walk->active) { printf("Output %s inactive, skipping...\n", outputs_walk->name); @@ -166,6 +176,17 @@ void draw_buttons() { outputs_walk->bargc, 1, &rect); + color = get_colorpixel("FFFFFF"); + xcb_change_gc(xcb_connection, + outputs_walk->bargc, + XCB_GC_FOREGROUND, + &color); + xcb_image_text_8(xcb_connection, + strlen(ws_walk->name), + outputs_walk->bar, + outputs_walk->bargc, + i + 3, 14, + ws_walk->name); i += 20; ws_walk = ws_walk->next; }