add bar width and leading offset configuration options

This commit is contained in:
Ivan Kanakarakis
2012-08-17 03:29:18 +03:00
parent f6801f83e3
commit 80fd31b32c
2 changed files with 10 additions and 7 deletions

13
bar.c
View File

@@ -322,21 +322,20 @@ init (void)
/* Grab infos from the first screen */
scr = xcb_setup_roots_iterator (xcb_get_setup (c)).data;
bar_width = scr->width_in_pixels;
root = scr->root;
/* where to place the window */
y = (bar_bottom) ? (scr->height_in_pixels - BAR_HEIGHT) : 0;
bar_width = (BAR_WIDTH < 0) ? (scr->width_in_pixels - OFFSET) : BAR_WIDTH;
/* Load the font */
if (font_load ((const char* []){ BAR_FONT }))
exit (1);
/* Create the main window */
win = xcb_generate_id (c);
if (bar_bottom)
y = scr->height_in_pixels - BAR_HEIGHT;
else
y = 0;
xcb_create_window (c, XCB_COPY_FROM_PARENT, win, root, 0, y,
bar_width, BAR_HEIGHT, 0, XCB_WINDOW_CLASS_INPUT_OUTPUT, scr->root_visual,
xcb_create_window (c, XCB_COPY_FROM_PARENT, win, root, OFFSET, y, bar_width,
BAR_HEIGHT, 0, XCB_WINDOW_CLASS_INPUT_OUTPUT, scr->root_visual,
XCB_CW_BACK_PIXEL | XCB_CW_EVENT_MASK, (const uint32_t []){ palette[0], XCB_EVENT_MASK_EXPOSURE });
/* Set EWMH hints */