sites

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

commit e3efdbaf42d116774249959211b8268acfa54cb1
parent fa9b1481ba14906393c7fd534bd2cfa70c50bd58
Author: lhark <lhark@ntymail.com>
Date:   Tue, 25 Feb 2020 20:34:38 -0500

[dwm][patch][status2d] Add background command

Diffstat:
Mdwm.suckless.org/patches/status2d/dwm-status2d-6.2.diff | 10+++++++++-
Mdwm.suckless.org/patches/status2d/index.md | 13++++++++-----
2 files changed, 17 insertions(+), 6 deletions(-)

diff --git a/dwm.suckless.org/patches/status2d/dwm-status2d-6.2.diff b/dwm.suckless.org/patches/status2d/dwm-status2d-6.2.diff @@ -28,7 +28,7 @@ index d27cb67..464c9d6 100644 free(scheme[i]); XDestroyWindow(dpy, wmcheckwin); drw_free(drw); -@@ -690,6 +691,106 @@ dirtomon(int dir) +@@ -690,6 +691,114 @@ dirtomon(int dir) return m; } @@ -75,6 +75,7 @@ index d27cb67..464c9d6 100644 + + drw_setscheme(drw, scheme[LENGTH(colors)]); + drw->scheme[ColFg] = scheme[SchemeNorm][ColFg]; ++ drw->scheme[ColBg] = scheme[SchemeNorm][ColBg]; + drw_rect(drw, x, 0, w, bh, 1, 1); + x++; + @@ -98,8 +99,15 @@ index d27cb67..464c9d6 100644 + buf[7] = '\0'; + drw_clr_create(drw, &drw->scheme[ColFg], buf); + i += 7; ++ } else if (text[i] == 'b') { ++ char buf[8]; ++ memcpy(buf, (char*)text+i+1, 7); ++ buf[7] = '\0'; ++ drw_clr_create(drw, &drw->scheme[ColBg], buf); ++ i += 7; + } else if (text[i] == 'd') { + drw->scheme[ColFg] = scheme[SchemeNorm][ColFg]; ++ drw->scheme[ColBg] = scheme[SchemeNorm][ColBg]; + } else if (text[i] == 'r') { + int rx = atoi(text + ++i); + while (text[++i] != ','); diff --git a/dwm.suckless.org/patches/status2d/index.md b/dwm.suckless.org/patches/status2d/index.md @@ -20,17 +20,20 @@ Usage * ^c#FF0000^: set foreground color. -* ^f11^: forward the x draawing cursor, only needed for drawings, not text. +* ^b#55cdfc^: set background color, only applies to text, use the ^r^ command to add backgrounds to your drawings -* ^d^: reset foreground color to SchemeNorm. +* ^f11^: forward the x drawing cursor, only needed for drawings, not text. + +* ^d^: reset colors to SchemeNorm. Example ------- -xsetroot -name "dwmstatus ^c#FF0000^ in red with red rectangle -^r0,0,10,10^^f10^^c#FFFFFF^ and white text" +xsetroot -name "[status2d] ^c#FF0000^red text with blue +rectangle^c#55cdfc^^r3,3,14,14^^f20^^c#FFFFFF^^b#f7a8b8^ +and white text on pink background " Authors ------- * [sipi](https://github.com/sipi) -* lhark - <lhark@ntymail.com> (6.2 port) +* lhark - <lhark@ntymail.com> (6.2 port, ^b^ command)