all repos — dwm @ dfd84f9bf3b9d949412a73bc62a43109b340d395

fork of suckless dynamic window manager

bar.c (view raw)

 1/*
 2 * (C)opyright MMVI Anselm R. Garbe <garbeam at gmail dot com>
 3 * See LICENSE file for license details.
 4 */
 5
 6#include "wm.h"
 7
 8void
 9draw_bar()
10{
11	brush.x = brush.y = 0;
12	brush.w = bw;
13	brush.h = bh;
14	draw(dpy, &brush, False, NULL);
15
16	if(stack) {
17		brush.w = textw(&brush.font, stack->name) + bh;
18		swap((void **)&brush.fg, (void **)&brush.bg);
19		draw(dpy, &brush, True, stack->name);
20		swap((void **)&brush.fg, (void **)&brush.bg);
21		brush.x += brush.w;
22	}
23
24	brush.w = textw(&brush.font, statustext) + bh;
25	brush.x = bx + bw - brush.w;
26	draw(dpy, &brush, False, statustext);
27	XCopyArea(dpy, brush.drawable, barwin, brush.gc, 0, 0, bw, bh, 0, 0);
28	XFlush(dpy);
29}