sites

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

st-gradient-0.8.4.diff (1083B)


      1 diff -up st/config.def.h st-gradient/config.def.h
      2 --- st/config.def.h	2021-01-12 03:24:27.313995808 +0530
      3 +++ st-gradient/config.def.h	2021-01-12 03:03:37.837696991 +0530
      4 @@ -95,6 +95,8 @@ unsigned int tabspaces = 8;
      5 
      6  /* bg opacity */
      7  float alpha = 0.8;
      8 +float grad_alpha = 0.54; //alpha value that'll change
      9 +float stat_alpha = 0.46; //constant alpha value that'll get added to grad_alpha
     10 
     11  /* Terminal colors (16 first used in escape sequence) */
     12  static const char *colorname[] = {
     13 Common subdirectories: st/.git and st-gradient/.git
     14 diff -up st/x.c st-gradient/x.c
     15 --- st/x.c	2021-01-12 03:24:27.313995808 +0530
     16 +++ st-gradient/x.c	2021-01-12 03:08:40.850694072 +0530
     17 @@ -1448,6 +1448,11 @@ xdrawglyphfontspecs(const XftGlyphFontSp
     18 
     19  	if (base.mode & ATTR_INVISIBLE)
     20  		fg = bg;
     21 +
     22 +	// gradient
     23 +	bg->color.alpha = grad_alpha * 0xffff * (win.h - y*win.ch) / win.h + stat_alpha * 0xffff;
     24 +	// uncomment to invert the gradient
     25 +	// bg->color.alpha = grad_alpha * 0xffff * (y*win.ch) / win.h + stat_alpha * 0xffff;
     26 
     27  	/* Intelligent cleaning up of the borders. */
     28  	if (x == 0) {