dwm-stickyindicator-6.2.diff - sites - public wiki contents of suckless.org | |
git clone git://git.suckless.org/sites | |
Log | |
Files | |
Refs | |
--- | |
dwm-stickyindicator-6.2.diff (3546B) | |
--- | |
1 diff -pu dwm.stickypatch/config.def.h dwm.stickyindicator/config.def.h | |
2 --- dwm.stickypatch/config.def.h 2021-02-28 23:51:25.118904642 -0… | |
3 +++ dwm.stickyindicator/config.def.h 2021-03-15 20:19:53.53332372… | |
4 @@ -17,6 +17,8 @@ static const char *colors[][3] = { | |
5 [SchemeNorm] = { col_gray3, col_gray1, col_gray2 }, | |
6 [SchemeSel] = { col_gray4, col_cyan, col_cyan }, | |
7 }; | |
8 +static const XPoint stickyicon[] = { {0,0}, {4,0}, {4,8}, {2,6}, {0,… | |
9 +static const XPoint stickyiconbb = {4,8}; /* defines the bott… | |
10 | |
11 /* tagging */ | |
12 static const char *tags[] = { "1", "2", "3", "4", "5", "6", "7", "8", "… | |
13 diff -pu dwm.stickypatch/drw.c dwm.stickyindicator/drw.c | |
14 --- dwm.stickypatch/drw.c 2021-02-28 23:51:06.992237482 -0600 | |
15 +++ dwm.stickyindicator/drw.c 2021-03-15 20:19:19.499990633 -0500 | |
16 @@ -248,6 +248,26 @@ drw_rect(Drw *drw, int x, int y, unsigne | |
17 XDrawRectangle(drw->dpy, drw->drawable, drw->gc, x, y, … | |
18 } | |
19 | |
20 +void | |
21 +drw_polygon(Drw *drw, int x, int y, int ow, int oh, int sw, int sh, con… | |
22 +{ | |
23 + if (!drw || !drw->scheme) | |
24 + return; | |
25 + XSetForeground(drw->dpy, drw->gc, drw->scheme[ColFg].pixel); | |
26 + if (!filled) { /* reduces the scaled width and height by 1 when… | |
27 + sw -= 1; | |
28 + sh -= 1; | |
29 + } | |
30 + XPoint scaledpoints[npoints]; | |
31 + memcpy(scaledpoints, points, npoints); | |
32 + for (int v = 0; v < npoints; v++) | |
33 + scaledpoints[v] = (XPoint){ .x = points[v].x * sw / ow … | |
34 + if (filled) | |
35 + XFillPolygon(drw->dpy, drw->drawable, drw->gc, scaledpo… | |
36 + else | |
37 + XDrawLines(drw->dpy, drw->drawable, drw->gc, scaledpoin… | |
38 +} | |
39 + | |
40 int | |
41 drw_text(Drw *drw, int x, int y, unsigned int w, unsigned int h, unsign… | |
42 { | |
43 diff -pu dwm.stickypatch/drw.h dwm.stickyindicator/drw.h | |
44 --- dwm.stickypatch/drw.h 2021-02-28 23:51:06.992237482 -0600 | |
45 +++ dwm.stickyindicator/drw.h 2021-03-01 01:34:02.739074730 -0600 | |
46 @@ -51,6 +51,7 @@ void drw_setscheme(Drw *drw, Clr *scm); | |
47 | |
48 /* Drawing functions */ | |
49 void drw_rect(Drw *drw, int x, int y, unsigned int w, unsigned int h, i… | |
50 +void drw_polygon(Drw *drw, int x, int y, int ow, int oh, int sw, int sh… | |
51 int drw_text(Drw *drw, int x, int y, unsigned int w, unsigned int h, un… | |
52 | |
53 /* Map functions */ | |
54 diff -pu dwm.stickypatch/dwm.c dwm.stickyindicator/dwm.c | |
55 --- dwm.stickypatch/dwm.c 2021-02-28 23:51:25.118904642 -0600 | |
56 +++ dwm.stickyindicator/dwm.c 2021-03-15 20:12:32.063326766 -0500 | |
57 @@ -736,6 +736,8 @@ drawbar(Monitor *m) | |
58 drw_text(drw, x, 0, w, bh, lrpad / 2, m->sel->n… | |
59 if (m->sel->isfloating) | |
60 drw_rect(drw, x + boxs, boxs, boxw, box… | |
61 + if (m->sel->issticky) | |
62 + drw_polygon(drw, x + boxs, m->sel->isfl… | |
63 } else { | |
64 drw_setscheme(drw, scheme[SchemeNorm]); | |
65 drw_rect(drw, x, 0, w, bh, 1, 1); |