My dwm build
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 

60 lines
1.9 KiB

  1. diff --git a/config.def.h b/config.def.h
  2. index 1c0b587..3fb5cf8 100644
  3. --- a/config.def.h
  4. +++ b/config.def.h
  5. @@ -21,6 +21,18 @@ static const char *colors[][3] = {
  6. /* tagging */
  7. static const char *tags[] = { "1", "2", "3", "4", "5", "6", "7", "8", "9" };
  8. +static const char *tagsel[][2] = {
  9. + { "#ffffff", "#ff0000" },
  10. + { "#ffffff", "#ff7f00" },
  11. + { "#000000", "#ffff00" },
  12. + { "#000000", "#00ff00" },
  13. + { "#ffffff", "#0000ff" },
  14. + { "#ffffff", "#4b0082" },
  15. + { "#ffffff", "#9400d3" },
  16. + { "#000000", "#ffffff" },
  17. + { "#ffffff", "#000000" },
  18. +};
  19. +
  20. static const Rule rules[] = {
  21. /* xprop(1):
  22. * WM_CLASS(STRING) = instance, class
  23. diff --git a/dwm.c b/dwm.c
  24. index b0b3466..c16d5f5 100644
  25. --- a/dwm.c
  26. +++ b/dwm.c
  27. @@ -264,6 +264,7 @@ static Atom wmatom[WMLast], netatom[NetLast];
  28. static int running = 1;
  29. static Cur *cursor[CurLast];
  30. static Clr **scheme;
  31. +static Clr **tagscheme;
  32. static Display *dpy;
  33. static Drw *drw;
  34. static Monitor *mons, *selmon;
  35. @@ -717,7 +718,7 @@ drawbar(Monitor *m)
  36. x = 0;
  37. for (i = 0; i < LENGTH(tags); i++) {
  38. w = TEXTW(tags[i]);
  39. - drw_setscheme(drw, scheme[m->tagset[m->seltags] & 1 << i ? SchemeSel : SchemeNorm]);
  40. + drw_setscheme(drw, (m->tagset[m->seltags] & 1 << i ? tagscheme[i] : scheme[SchemeNorm]));
  41. drw_text(drw, x, 0, w, bh, lrpad / 2, tags[i], urg & 1 << i);
  42. if (occ & 1 << i)
  43. drw_rect(drw, x + boxs, boxs, boxw, boxw,
  44. @@ -1568,9 +1569,14 @@ setup(void)
  45. cursor[CurResize] = drw_cur_create(drw, XC_sizing);
  46. cursor[CurMove] = drw_cur_create(drw, XC_fleur);
  47. /* init appearance */
  48. + if (LENGTH(tags) > LENGTH(tagsel))
  49. + die("too few color schemes for the tags");
  50. scheme = ecalloc(LENGTH(colors), sizeof(Clr *));
  51. for (i = 0; i < LENGTH(colors); i++)
  52. scheme[i] = drw_scm_create(drw, colors[i], 3);
  53. + tagscheme = ecalloc(LENGTH(tagsel), sizeof(Clr *));
  54. + for (i = 0; i < LENGTH(tagsel); i++)
  55. + tagscheme[i] = drw_scm_create(drw, tagsel[i], 2);
  56. /* init bars */
  57. updatebars();
  58. updatestatus();