start of patch

This commit is contained in:
Linux User 2022-08-15 07:40:34 +00:00
parent 36973c8e08
commit ca8ea3f462
3 changed files with 16 additions and 6 deletions

BIN
dwm

Binary file not shown.

22
dwm.c
View File

@ -238,7 +238,7 @@ static void zoom(const Arg *arg);
/* variables */ /* variables */
static const char broken[] = "broken"; static const char broken[] = "broken";
static char stext[256]; static char stext[1024];
static int screen; static int screen;
static int sw, sh; /* X display screen geometry width, height */ static int sw, sh; /* X display screen geometry width, height */
static int bh, blw = 0; /* bar geometry */ static int bh, blw = 0; /* bar geometry */
@ -490,7 +490,7 @@ cleanup(void)
cleanupmon(mons); cleanupmon(mons);
for (i = 0; i < CurLast; i++) for (i = 0; i < CurLast; i++)
drw_cur_free(drw, cursor[i]); drw_cur_free(drw, cursor[i]);
for (i = 0; i < LENGTH(colors); i++) for (i = 0; i < LENGTH(colors) + 1; i++)
free(scheme[i]); free(scheme[i]);
free(scheme); free(scheme);
XDestroyWindow(dpy, wmcheckwin); XDestroyWindow(dpy, wmcheckwin);
@ -700,6 +700,14 @@ dirtomon(int dir)
return m; return m;
} }
void
drawstatusbar(Monitor *m, int bh, char* stext) {
// drw_setscheme(drw, scheme[SchemeNorm]);
// tw = TEXTW(stext); /* - lrpad + 2; * 2px right padding */
// drw_text(drw, m->ww - tw - 2 * hpb, 0, tw, bh, lrpad / 2, stext, 0);
}
void void
drawbar(Monitor *m) drawbar(Monitor *m)
{ {
@ -714,9 +722,10 @@ drawbar(Monitor *m)
/* draw status first so it can be overdrawn by tags later */ /* draw status first so it can be overdrawn by tags later */
if (m == selmon) { /* status is only drawn on selected monitor */ if (m == selmon) { /* status is only drawn on selected monitor */
drw_setscheme(drw, scheme[SchemeNorm]); // drw_setscheme(drw, scheme[SchemeNorm]);
tw = TEXTW(stext); /* - lrpad + 2; * 2px right padding */ // tw = TEXTW(stext); /* - lrpad + 2; * 2px right padding */
drw_text(drw, m->ww - tw - 2 * hpb, 0, tw, bh, lrpad / 2, stext, 0); // drw_text(drw, m->ww - tw - 2 * hpb, 0, tw, bh, lrpad / 2, stext, 0);
tw = m->ww - drawstatusbar(m, bh, stext);
} }
for (c = m->clients; c; c = c->next) { for (c = m->clients; c; c = c->next) {
@ -1574,7 +1583,8 @@ setup(void)
cursor[CurResize] = drw_cur_create(drw, XC_sizing); cursor[CurResize] = drw_cur_create(drw, XC_sizing);
cursor[CurMove] = drw_cur_create(drw, XC_fleur); cursor[CurMove] = drw_cur_create(drw, XC_fleur);
/* init appearance */ /* init appearance */
scheme = ecalloc(LENGTH(colors), sizeof(Clr *)); scheme = ecalloc(LENGTH(colors) + 1, sizeof(Clr *));
scheme[LENGTH(colors)] = drw_scm_create(drw, colors[0], 3);
for (i = 0; i < LENGTH(colors); i++) for (i = 0; i < LENGTH(colors); i++)
scheme[i] = drw_scm_create(drw, colors[i], 3); scheme[i] = drw_scm_create(drw, colors[i], 3);
/* init bars */ /* init bars */

BIN
dwm.o

Binary file not shown.