applied Markus' decouple color-scheme patch
975c8983
2 file(s) · +8 −6
| 12 | 12 | static const char col_gray3[] = "#bbbbbb"; |
|
| 13 | 13 | static const char col_gray4[] = "#eeeeee"; |
|
| 14 | 14 | static const char col_cyan[] = "#005577"; |
|
| 15 | - | static const char *colors[SchemeLast][3] = { |
|
| 15 | + | static const char *colors[][3] = { |
|
| 16 | 16 | /* fg bg border */ |
|
| 17 | 17 | [SchemeNorm] = { col_gray3, col_gray1, col_gray2 }, |
|
| 18 | 18 | [SchemeSel] = { col_gray4, col_cyan, col_cyan }, |
| 60 | 60 | ||
| 61 | 61 | /* enums */ |
|
| 62 | 62 | enum { CurNormal, CurResize, CurMove, CurLast }; /* cursor */ |
|
| 63 | - | enum { SchemeNorm, SchemeSel, SchemeLast }; /* color schemes */ |
|
| 63 | + | enum { SchemeNorm, SchemeSel }; /* color schemes */ |
|
| 64 | 64 | enum { NetSupported, NetWMName, NetWMState, |
|
| 65 | 65 | NetWMFullscreen, NetActiveWindow, NetWMWindowType, |
|
| 66 | 66 | NetWMWindowTypeDialog, NetClientList, NetLast }; /* EWMH atoms */ |
|
| 263 | 263 | static Atom wmatom[WMLast], netatom[NetLast]; |
|
| 264 | 264 | static int running = 1; |
|
| 265 | 265 | static Cur *cursor[CurLast]; |
|
| 266 | - | static Scm scheme[SchemeLast]; |
|
| 266 | + | static Scm *scheme; |
|
| 267 | 267 | static Display *dpy; |
|
| 268 | 268 | static Drw *drw; |
|
| 269 | 269 | static Monitor *mons, *selmon; |
|
| 483 | 483 | cleanupmon(mons); |
|
| 484 | 484 | for (i = 0; i < CurLast; i++) |
|
| 485 | 485 | drw_cur_free(drw, cursor[i]); |
|
| 486 | - | for (i = 0; i < SchemeLast; i++) |
|
| 486 | + | for (i = 0; i < LENGTH(colors); i++) |
|
| 487 | 487 | free(scheme[i]); |
|
| 488 | 488 | drw_free(drw); |
|
| 489 | 489 | XSync(dpy, False); |
|
| 1549 | 1549 | void |
|
| 1550 | 1550 | setup(void) |
|
| 1551 | 1551 | { |
|
| 1552 | + | int i; |
|
| 1552 | 1553 | XSetWindowAttributes wa; |
|
| 1553 | 1554 | ||
| 1554 | 1555 | /* clean up any zombies immediately */ |
|
| 1583 | 1584 | cursor[CurResize] = drw_cur_create(drw, XC_sizing); |
|
| 1584 | 1585 | cursor[CurMove] = drw_cur_create(drw, XC_fleur); |
|
| 1585 | 1586 | /* init appearance */ |
|
| 1586 | - | scheme[SchemeNorm] = drw_scm_create(drw, colors[SchemeNorm], 3); |
|
| 1587 | - | scheme[SchemeSel] = drw_scm_create(drw, colors[SchemeSel], 3); |
|
| 1587 | + | scheme = ecalloc(LENGTH(colors), sizeof(Scm)); |
|
| 1588 | + | for (i = 0; i < LENGTH(colors); i++) |
|
| 1589 | + | scheme[i] = drw_scm_create(drw, colors[i], 3); |
|
| 1588 | 1590 | /* init bars */ |
|
| 1589 | 1591 | updatebars(); |
|
| 1590 | 1592 | updatestatus(); |
|