aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJoe <rrbo@proton.me>2023-12-04 10:09:49 +0100
committerJoe <rrbo@proton.me>2023-12-04 10:09:49 +0100
commit5f53d3c02e16b68a88926b2f4c5d0fcd5f8a3078 (patch)
treefc5033f640b578fecf872fb060376dacca8fc6d6
parentup (diff)
downloaddwm-5f53d3c02e16b68a88926b2f4c5d0fcd5f8a3078.tar.gz
dwm-5f53d3c02e16b68a88926b2f4c5d0fcd5f8a3078.tar.bz2
dwm-5f53d3c02e16b68a88926b2f4c5d0fcd5f8a3078.tar.xz
dwm-5f53d3c02e16b68a88926b2f4c5d0fcd5f8a3078.tar.zst
dwm-5f53d3c02e16b68a88926b2f4c5d0fcd5f8a3078.zip
up
-rw-r--r--config.h21
-rw-r--r--dwm.c8
2 files changed, 23 insertions, 6 deletions
diff --git a/config.h b/config.h
index ded273e..0541b8b 100644
--- a/config.h
+++ b/config.h
@@ -31,6 +31,18 @@ static const char *colors[][3] = {
/* tagging */
static const char *tags[] = { "1", "2", "3", "4", "5", "6", "7", "8", "9" };
+static const char *tagsel[][2] = {
+ { "#ffffff", "#ff0000" },
+ { "#ffffff", "#ff7f00" },
+ { "#000000", "#ffff00" },
+ { "#000000", "#00ff00" },
+ { "#ffffff", "#0000ff" },
+ { "#ffffff", "#4b0082" },
+ { "#ffffff", "#9400d3" },
+ { "#000000", "#ffffff" },
+ { "#ffffff", "#000000" },
+};
+
/* grid of tags */
#define DRAWCLASSICTAGS 1 << 0
@@ -59,12 +71,11 @@ static const Rule rules[] = {
{ "xterm-256color", NULL, NULL, 0, 0, 0, 0, -1 },
{ "mpv", NULL, NULL, 0, 0, 0, 0, -1 },
{ "Alacritty", NULL, NULL, 0, 0, 0, 0, -1 },
- { "KeePass2", NULL, NULL, 0, 0, 1, 0, -1 },
- { "org.remmina.Remmina", NULL, NULL, 1 << 5, 0, 0, 0, -1 },
- { "Vmware", NULL, NULL, 1 << 6, 0, 0, 0, -1 },
- { "rclone-browser", NULL, NULL, 1 << 7, 0, 0, 0, -1 },
+ { "rclone-browser", NULL, NULL, 1 << 1, 0, 0, 0, 2 },
+ { "org.remmina.Remmina", NULL, NULL, 1 << 2, 0, 0, 0, 2 },
+ { "Vmware", NULL, NULL, 1 << 3, 0, 0, 0, 2 },
{ "Microsoft Teams - Preview", NULL, NULL, 0, 0, 0, 0, 1 },
- { "thunderbird", NULL, NULL, 0, 0, 0, 0, 1 },
+ { "thunderbird", NULL, NULL, 1 << 1, 0, 0, 0, 1 },
{ NULL, NULL, "Event Tester", 0, 0, 0, 0, -1 }, /* xev */
};
diff --git a/dwm.c b/dwm.c
index a25eb41..d6788e0 100644
--- a/dwm.c
+++ b/dwm.c
@@ -316,6 +316,7 @@ static Atom wmatom[WMLast], netatom[NetLast], xatom[XLast];
static int running = 1;
static Cur *cursor[CurLast];
static Clr **scheme;
+static Clr **tagscheme;
static Display *dpy;
static Drw *drw;
static Monitor *mons, *selmon;
@@ -906,7 +907,7 @@ drawbar(Monitor *m)
if (drawtagmask & DRAWCLASSICTAGS)
for (i = 0; i < LENGTH(tags); i++) {
w = TEXTW(tags[i]);
- drw_setscheme(drw, scheme[m->tagset[m->seltags] & 1 << i ? SchemeSel : SchemeNorm]);
+ drw_setscheme(drw, (m->tagset[m->seltags] & 1 << i ? tagscheme[i] : scheme[SchemeNorm]));
drw_text(drw, x, 0, w, bh, lrpad / 2, tags[i], urg & 1 << i);
if (occ & 1 << i)
drw_rect(drw, x + boxs, boxs, boxw, boxw,
@@ -1920,9 +1921,14 @@ setup(void)
cursor[CurResize] = drw_cur_create(drw, XC_sizing);
cursor[CurMove] = drw_cur_create(drw, XC_fleur);
/* init appearance */
+ if (LENGTH(tags) > LENGTH(tagsel))
+ die("too few color schemes for the tags");
scheme = ecalloc(LENGTH(colors), sizeof(Clr *));
for (i = 0; i < LENGTH(colors); i++)
scheme[i] = drw_scm_create(drw, colors[i], 3);
+ tagscheme = ecalloc(LENGTH(tagsel), sizeof(Clr *));
+ for (i = 0; i < LENGTH(tagsel); i++)
+ tagscheme[i] = drw_scm_create(drw, tagsel[i], 2);
/* init system tray */
updatesystray();
/* init bars */