sites

public wiki contents of suckless.org
git clone git://git.suckless.org/sites
Log | Files | Refs

dwm-colorbar-6.3.diff (3645B)


      1 From 647a2a56cf7cab6dea868f9800671770940ce3c3 Mon Sep 17 00:00:00 2001
      2 From: Alessandro Sisto <alessandro.sisto@studioform.net>
      3 Date: Sun, 5 Jun 2022 12:03:43 +0200
      4 Subject: [PATCH] colorbar
      5 
      6 ---
      7  config.def.h |  6 +++++-
      8  dwm.c        | 12 ++++++------
      9  2 files changed, 11 insertions(+), 7 deletions(-)
     10 
     11 diff --git a/config.def.h b/config.def.h
     12 index a2ac963..56bc324 100644
     13 --- a/config.def.h
     14 +++ b/config.def.h
     15 @@ -16,6 +16,11 @@ static const char *colors[][3]      = {
     16  	/*               fg         bg         border   */
     17  	[SchemeNorm] = { col_gray3, col_gray1, col_gray2 },
     18  	[SchemeSel]  = { col_gray4, col_cyan,  col_cyan  },
     19 +	[SchemeStatus]  = { col_gray3, col_gray1,  "#000000"  }, // Statusbar right {text,background,not used but cannot be empty}
     20 +	[SchemeTagsSel]  = { col_gray4, col_cyan,  "#000000"  }, // Tagbar left selected {text,background,not used but cannot be empty}
     21 +	[SchemeTagsNorm]  = { col_gray3, col_gray1,  "#000000"  }, // Tagbar left unselected {text,background,not used but cannot be empty}
     22 +	[SchemeInfoSel]  = { col_gray4, col_cyan,  "#000000"  }, // infobar middle  selected {text,background,not used but cannot be empty}
     23 +	[SchemeInfoNorm]  = { col_gray3, col_gray1,  "#000000"  }, // infobar middle  unselected {text,background,not used but cannot be empty}
     24  };
     25  
     26  /* tagging */
     27 @@ -113,4 +118,3 @@ static Button buttons[] = {
     28  	{ ClkTagBar,            MODKEY,         Button1,        tag,            {0} },
     29  	{ ClkTagBar,            MODKEY,         Button3,        toggletag,      {0} },
     30  };
     31 -
     32 diff --git a/dwm.c b/dwm.c
     33 index a96f33c..0eaa4cd 100644
     34 --- a/dwm.c
     35 +++ b/dwm.c
     36 @@ -59,7 +59,7 @@
     37  
     38  /* enums */
     39  enum { CurNormal, CurResize, CurMove, CurLast }; /* cursor */
     40 -enum { SchemeNorm, SchemeSel }; /* color schemes */
     41 +enum { SchemeNorm, SchemeSel, SchemeStatus, SchemeTagsSel, SchemeTagsNorm, SchemeInfoSel, SchemeInfoNorm }; /* color schemes */
     42  enum { NetSupported, NetWMName, NetWMState, NetWMCheck,
     43         NetWMFullscreen, NetActiveWindow, NetWMWindowType,
     44         NetWMWindowTypeDialog, NetClientList, NetLast }; /* EWMH atoms */
     45 @@ -707,7 +707,7 @@ drawbar(Monitor *m)
     46  
     47  	/* draw status first so it can be overdrawn by tags later */
     48  	if (m == selmon) { /* status is only drawn on selected monitor */
     49 -		drw_setscheme(drw, scheme[SchemeNorm]);
     50 +		drw_setscheme(drw, scheme[SchemeStatus]);
     51  		tw = TEXTW(stext) - lrpad + 2; /* 2px right padding */
     52  		drw_text(drw, m->ww - tw, 0, tw, bh, 0, stext, 0);
     53  	}
     54 @@ -720,7 +720,7 @@ drawbar(Monitor *m)
     55  	x = 0;
     56  	for (i = 0; i < LENGTH(tags); i++) {
     57  		w = TEXTW(tags[i]);
     58 -		drw_setscheme(drw, scheme[m->tagset[m->seltags] & 1 << i ? SchemeSel : SchemeNorm]);
     59 +		drw_setscheme(drw, scheme[m->tagset[m->seltags] & 1 << i ? SchemeTagsSel : SchemeTagsNorm]);
     60  		drw_text(drw, x, 0, w, bh, lrpad / 2, tags[i], urg & 1 << i);
     61  		if (occ & 1 << i)
     62  			drw_rect(drw, x + boxs, boxs, boxw, boxw,
     63 @@ -729,17 +729,17 @@ drawbar(Monitor *m)
     64  		x += w;
     65  	}
     66  	w = blw = TEXTW(m->ltsymbol);
     67 -	drw_setscheme(drw, scheme[SchemeNorm]);
     68 +	drw_setscheme(drw, scheme[SchemeTagsNorm]);
     69  	x = drw_text(drw, x, 0, w, bh, lrpad / 2, m->ltsymbol, 0);
     70  
     71  	if ((w = m->ww - tw - x) > bh) {
     72  		if (m->sel) {
     73 -			drw_setscheme(drw, scheme[m == selmon ? SchemeSel : SchemeNorm]);
     74 +			drw_setscheme(drw, scheme[m == selmon ? SchemeInfoSel : SchemeInfoNorm]);
     75  			drw_text(drw, x, 0, w, bh, lrpad / 2, m->sel->name, 0);
     76  			if (m->sel->isfloating)
     77  				drw_rect(drw, x + boxs, boxs, boxw, boxw, m->sel->isfixed, 0);
     78  		} else {
     79 -			drw_setscheme(drw, scheme[SchemeNorm]);
     80 +			drw_setscheme(drw, scheme[SchemeInfoNorm]);
     81  			drw_rect(drw, x, 0, w, bh, 1, 1);
     82  		}
     83  	}
     84 -- 
     85 2.36.1
     86