summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjon <jonrevold@gmail.com>2020-07-13 10:38:26 +0200
committerjon <jonrevold@gmail.com>2020-07-13 10:38:26 +0200
commit72df1c0a927e23b2d5206406d7a59e8cfb7454df (patch)
tree4f6a534148c062bc86ea35e47e0e49401760d870
parent900c730d8a6de875ba2e30389b929dcad6ded026 (diff)
downloaddwm-72df1c0a927e23b2d5206406d7a59e8cfb7454df.tar.gz
ok
-rw-r--r--config.h14
-rw-r--r--dwm.c20
2 files changed, 29 insertions, 5 deletions
diff --git a/config.h b/config.h
index 5b58829..acdfb4c 100644
--- a/config.h
+++ b/config.h
@@ -12,10 +12,18 @@ static const char col_gray2[] = "#444444";
static const char col_gray3[] = "#bbbbbb";
static const char col_gray4[] = "#eeeeee";
static const char col_cyan[] = "#005577";
+static const char col_black[] = "#000000";
+static const char col_red[] = "#ff0000";
+static const char col_yellow[] = "#ffff00";
+static const char col_green[] = "#00ff00";
+static const char col_white[] = "#ffffff";
static const char *colors[][3] = {
- /* fg bg border */
- [SchemeNorm] = { col_gray3, col_gray1, col_gray2 },
- [SchemeSel] = { col_gray4, col_cyan, col_cyan },
+ /* fg bg border */
+ [SchemeNorm] = { col_gray3, col_gray1, col_gray2 },
+ [SchemeSel] = { col_gray4, col_cyan, col_cyan },
+ [SchemeWarn] = { col_yellow, col_gray1, col_gray2 },
+ [SchemeUrgent] = { col_red, col_gray1, col_gray2 },
+ [SchemeOke] = { col_green, col_gray1, col_gray2 },
};
/* tagging */
diff --git a/dwm.c b/dwm.c
index 58e08b9..fb5b34a 100644
--- a/dwm.c
+++ b/dwm.c
@@ -60,7 +60,8 @@
/* enums */
enum { CurNormal, CurResize, CurMove, CurLast }; /* cursor */
-enum { SchemeNorm, SchemeSel }; /* color schemes */
+//enum { SchemeNorm, SchemeSel }; /* color schemes */
+enum { SchemeNorm, SchemeSel, SchemeWarn, SchemeUrgent, SchemeOke }; /* color schemes */
enum { NetSupported, NetWMName, NetWMState, NetWMCheck,
NetWMFullscreen, NetActiveWindow, NetWMWindowType,
NetWMWindowTypeDialog, NetClientList, NetLast }; /* EWMH atoms */
@@ -706,13 +707,28 @@ drawbar(Monitor *m)
int boxs = drw->fonts->h / 9;
int boxw = drw->fonts->h / 6 + 2;
unsigned int i, occ = 0, urg = 0;
+ char *ts = stext;
+ char *tp = stext;
+ int tx = 0;
+ char ctmp;
Client *c;
/* draw status first so it can be overdrawn by tags later */
if (m == selmon) { /* status is only drawn on selected monitor */
drw_setscheme(drw, scheme[SchemeNorm]);
tw = TEXTW(stext) - lrpad + 2; /* 2px right padding */
- drw_text(drw, m->ww - tw, 0, tw, bh, 0, stext, 0);
+ //drw_text(drw, m->ww - tw, 0, tw, bh, 0, stext, 0);
+ while (1) {
+ if ((unsigned int)*ts > LENGTH(colors)) { ts++; continue ; }
+ ctmp = *ts;
+ *ts = '\0';
+ drw_text(drw, m->ww - tw + tx, 0, tw - tx, bh, 0, tp, 0);
+ tx += TEXTW(tp) -lrpad;
+ if (ctmp == '\0') { break; }
+ drw_setscheme(drw, scheme[(unsigned int)(ctmp-1)]);
+ *ts = ctmp;
+ tp = ++ts;
+ }
}
for (c = m->clients; c; c = c->next) {