about summary refs log tree commit diff stats
path: root/bar.c
blob: f70a246ff4cee78f957c07bf84231599b7b398ed (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
/*
 * (C)opyright MMVI Anselm R. Garbe <garbeam at gmail dot com>
 * See LICENSE file for license details.
 */

#include "wm.h"

void
draw_bar()
{
	brush.x = brush.y = 0;
	brush.w = bw;
	brush.h = bh;
	draw(dpy, &brush, False, NULL);

	if(stack) {
		brush.w = textw(&brush.font, stack->name) + bh;
		swap((void **)&brush.fg, (void **)&brush.bg);
		draw(dpy, &brush, True, stack->name);
		swap((void **)&brush.fg, (void **)&brush.bg);
		brush.x += brush.w;
	}

	brush.w = textw(&brush.font, statustext) + bh;
	brush.x = bx + bw - brush.w;
	draw(dpy, &brush, False, statustext);
	XCopyArea(dpy, brush.drawable, barwin, brush.gc, 0, 0, bw, bh, 0, 0);
	XFlush(dpy);
}
und and background. // - Use only the terminal palette in the range 16-255. // - Not all terminals may support more than 256 colors. (I'm not yet sure // everyone has even 256 colors. If you don't, please let me know: // http://akkartik.name/contact) // - Many terminals provide color schemes which give the ability to tweak // colors 0-15. This makes it hard to assume specific combinations are // legible. I'm hoping most terminal emulators don't tend to encourage // messing with colors 16-255. (Please let me know if you know of // counter-examples.) // // For now, you have to edit these values if you want to adjust colors in the // editing environment. Check out https://www.robmeerman.co.uk/unix/256colours // for a map of available colors. // Toggle between a few color schemes #define COLOR_SCHEME 0 #if COLOR_SCHEME == 0 // Light color scheme. enum color { COLOR_FOREGROUND = 238, // almost black COLOR_BACKGROUND = 253, // almost white COLOR_FADE = 244, // closer to background COLOR_MENU_ALTERNATE = 248, COLOR_HIGHLIGHT_FOREGROUND = 238, COLOR_HIGHLIGHT_BACKGROUND = 250, COLOR_ERROR_FOREGROUND = COLOR_BACKGROUND, COLOR_ERROR_BACKGROUND = 124, // deep red COLOR_LUA_COMMENT = 27, // blue COLOR_LUA_KEYWORD = 172, // orange COLOR_LUA_CONSTANT = 31, // cyan COLOR_MATCH_FOREGROUND = COLOR_BACKGROUND, COLOR_MATCH_BACKGROUND = 28, // green }; #elif COLOR_SCHEME == 1 // Dark color scheme. enum color { COLOR_FOREGROUND = 253, // almost white COLOR_BACKGROUND = 238, // almost black COLOR_FADE = 244, // closer to background COLOR_MENU_ALTERNATE = 244, COLOR_HIGHLIGHT_FOREGROUND = 238, COLOR_HIGHLIGHT_BACKGROUND = 250, COLOR_ERROR_FOREGROUND = COLOR_FOREGROUND, COLOR_ERROR_BACKGROUND = 124, // deep red COLOR_LUA_COMMENT = 39, // blue COLOR_LUA_KEYWORD = 172, // orange COLOR_LUA_CONSTANT = 37, // cyan COLOR_MATCH_FOREGROUND = COLOR_BACKGROUND, COLOR_MATCH_BACKGROUND = 28, // green }; #elif COLOR_SCHEME == 2 // Solarized dark. enum color { COLOR_FOREGROUND = 250, // almost white COLOR_BACKGROUND = 24, // dark blue-green COLOR_FADE = 246, // closer to background COLOR_MENU_ALTERNATE = 244, COLOR_HIGHLIGHT_FOREGROUND = 250, COLOR_HIGHLIGHT_BACKGROUND = 31, COLOR_ERROR_FOREGROUND = 250, COLOR_ERROR_BACKGROUND = 124, // deep red COLOR_LUA_COMMENT = 45, // light blue COLOR_LUA_KEYWORD = 172, // orange COLOR_LUA_CONSTANT = 37, // cyan COLOR_MATCH_FOREGROUND = COLOR_FOREGROUND, COLOR_MATCH_BACKGROUND = 125, // magenta }; #endif enum color_pair { COLOR_PAIR_NORMAL = 0, COLOR_PAIR_HIGHLIGHT = 1, COLOR_PAIR_FADE = 2, COLOR_PAIR_MENU_ALTERNATE = 3, COLOR_PAIR_LUA_COMMENT = 4, COLOR_PAIR_LUA_KEYWORD = 5, COLOR_PAIR_LUA_CONSTANT = 6, COLOR_PAIR_MATCH = 7, COLOR_PAIR_ERROR = 255, }; #endif