dotfiles

My beautiful configs and dotfiles managed by Nix' home-manager
Log | Files | Refs | README | LICENSE

tabbed-colorscheme.diff (2843B)


      1 diff --git a/config.def.h b/config.def.h
      2 index 51bb13d..d84a2ba 100644
      3 --- a/config.def.h
      4 +++ b/config.def.h
      5 @@ -2,12 +2,13 @@
      6  
      7  /* appearance */
      8  static const char font[]        = "monospace:size=9";
      9 -static const char* normbgcolor  = "#222222";
     10 -static const char* normfgcolor  = "#cccccc";
     11 -static const char* selbgcolor   = "#555555";
     12 -static const char* selfgcolor   = "#ffffff";
     13 -static const char* urgbgcolor   = "#111111";
     14 -static const char* urgfgcolor   = "#cc0000";
     15 +static const char *colors[][3] = { // dark
     16 +    /*               fg         bg         border   */
     17 +    [SchemeNorm] = {"#222222", "#222222", 0},
     18 +    [SchemeSel] = {"#ffffff", "#555555", 0},
     19 +    [SchemeUrg] = {"#cc0000", "#111111", 0},
     20 +};
     21 +
     22  static const char before[]      = "<";
     23  static const char after[]       = ">";
     24  static const char titletrim[]   = "...";
     25 diff --git a/tabbed.c b/tabbed.c
     26 index 81be5e4..6a15001 100644
     27 --- a/tabbed.c
     28 +++ b/tabbed.c
     29 @@ -51,6 +51,7 @@
     30  enum { ColFG, ColBG, ColLast };       /* color */
     31  enum { WMProtocols, WMDelete, WMName, WMState, WMFullscreen,
     32         XEmbed, WMSelectTab, WMLast }; /* default atoms */
     33 +enum { SchemeNorm, SchemeSel, SchemeUrg }; /* schemes */
     34  
     35  typedef union {
     36  	int i;
     37 @@ -1037,12 +1038,12 @@ setup(void)
     38  			wy = dh + wy - wh - 1;
     39  	}
     40  
     41 -	dc.norm[ColBG] = getcolor(normbgcolor);
     42 -	dc.norm[ColFG] = getcolor(normfgcolor);
     43 -	dc.sel[ColBG] = getcolor(selbgcolor);
     44 -	dc.sel[ColFG] = getcolor(selfgcolor);
     45 -	dc.urg[ColBG] = getcolor(urgbgcolor);
     46 -	dc.urg[ColFG] = getcolor(urgfgcolor);
     47 +	dc.norm[ColBG] = getcolor(colors[SchemeNorm][1]);
     48 +	dc.norm[ColFG] = getcolor(colors[SchemeNorm][0]);
     49 +	dc.sel[ColBG] = getcolor(colors[SchemeSel][1]);
     50 +	dc.sel[ColFG] = getcolor(colors[SchemeSel][0]);
     51 +	dc.urg[ColBG] = getcolor(colors[SchemeUrg][1]);
     52 +	dc.urg[ColFG] = getcolor(colors[SchemeUrg][0]);
     53  	dc.drawable = XCreatePixmap(dpy, root, ww, wh,
     54  	                            DefaultDepth(dpy, screen));
     55  	dc.gc = XCreateGC(dpy, root, 0, 0);
     56 @@ -1307,10 +1308,10 @@ main(int argc, char *argv[])
     57  		wmname = EARGF(usage());
     58  		break;
     59  	case 'O':
     60 -		normfgcolor = EARGF(usage());
     61 +		colors[SchemeNorm][0] = EARGF(usage());
     62  		break;
     63  	case 'o':
     64 -		normbgcolor = EARGF(usage());
     65 +		colors[SchemeNorm][1] = EARGF(usage());
     66  		break;
     67  	case 'p':
     68  		pstr = EARGF(usage());
     69 @@ -1328,16 +1329,16 @@ main(int argc, char *argv[])
     70  		doinitspawn = False;
     71  		break;
     72  	case 'T':
     73 -		selfgcolor = EARGF(usage());
     74 +		colors[SchemeSel][0] = EARGF(usage());
     75  		break;
     76  	case 't':
     77 -		selbgcolor = EARGF(usage());
     78 +		colors[SchemeSel][1] = EARGF(usage());
     79  		break;
     80  	case 'U':
     81 -		urgfgcolor = EARGF(usage());
     82 +		colors[SchemeUrg][0] = EARGF(usage());
     83  		break;
     84  	case 'u':
     85 -		urgbgcolor = EARGF(usage());
     86 +		colors[SchemeUrg][1] = EARGF(usage());
     87  		break;
     88  	case 'v':
     89  		die("tabbed-"VERSION", © 2009-2016 tabbed engineers, "