- loadcolors(dpy, screen, &brush, BGCOLOR, FGCOLOR, BORDERCOLOR);
- loadfont(dpy, &brush.font, FONT);
-
- wa.override_redirect = 1;
- wa.background_pixmap = ParentRelative;
- wa.event_mask = ExposureMask;
-
- barrect = rect;
- barrect.height = labelheight(&brush.font);
- barrect.y = rect.height - barrect.height;
- barwin = XCreateWindow(dpy, root, barrect.x, barrect.y,
- barrect.width, barrect.height, 0, DefaultDepth(dpy, screen),
- CopyFromParent, DefaultVisual(dpy, screen),
- CWOverrideRedirect | CWBackPixmap | CWEventMask, &wa);
- XDefineCursor(dpy, barwin, cursor[CurNormal]);
- XMapRaised(dpy, barwin);
-
- brush.drawable = XCreatePixmap(dpy, root, rect.width, barrect.height,
- DefaultDepth(dpy, screen));
- brush.gc = XCreateGC(dpy, root, 0, 0);
-
- pipe_spawn(statustext, sizeof(statustext), dpy, (char **)status);
- draw_bar();
+ initcolors(BGCOLOR, FGCOLOR, BORDERCOLOR);
+ initfont(&dc.font, FONT);
+
+ th = texth(&dc.font);
+
+ dc.drawable = XCreatePixmap(dpy, root, sw, th, DefaultDepth(dpy, screen));
+ dc.gc = XCreateGC(dpy, root, 0, 0);