summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjonsykkel <jonrevold@gmail.com>2021-01-05 19:25:02 +0100
committerjonsykkel <jonrevold@gmail.com>2021-01-05 19:25:02 +0100
commit4f8fdcb35e8a31057e5bb7127a3b12fb4bc665a9 (patch)
tree5ab1ef56618ee63b102fd02f7d3a046d9664f054
parentfe03729505e411e8950892f8e29d50487fd9db0c (diff)
downloaddwm-4f8fdcb35e8a31057e5bb7127a3b12fb4bc665a9.tar.gz
lern to gode ffs
-rw-r--r--dwm.c16
1 files changed, 14 insertions, 2 deletions
diff --git a/dwm.c b/dwm.c
index 656fc71..d381cf3 100644
--- a/dwm.c
+++ b/dwm.c
@@ -700,6 +700,12 @@ dirtomon(int dir)
return m;
}
+static void strcpy_for_special_ppl(char *dst,char const *src){
+ do{
+ if(*src == 0 || *src >= 0x20) *dst++ = *src;
+ }while(*src++);
+}
+
void
drawbar(Monitor *m)
{
@@ -707,16 +713,19 @@ drawbar(Monitor *m)
int boxs = drw->fonts->h / 9;
int boxw = drw->fonts->h / 6 + 2;
unsigned int i, occ = 0, urg = 0;
+ char utext[sizeof(stext)];
char *ts = stext;
char *tp = stext;
int tx = 0;
char ctmp;
Client *c;
+ strcpy_for_special_ppl(utext,stext);
+
/* draw status first so it can be overdrawn by tags later */
// if (m == selmon) { /* status is only drawn on selected monitor */
drw_setscheme(drw, scheme[SchemeNorm]);
- tw = TEXTW(stext) - lrpad + 2; /* 2px right padding */
+ tw = TEXTW(utext) - lrpad + 2; /* 2px right padding */
//drw_text(drw, m->ww - tw, 0, tw, bh, 0, stext, 0);
while (1) {
if ((unsigned int)*ts > LENGTH(colors)) { ts++; continue ; }
@@ -2104,7 +2113,10 @@ updatestatus(void)
{
if (!gettextprop(root, XA_WM_NAME, stext, sizeof(stext)))
strcpy(stext, "dwm-"VERSION);
- drawbar(selmon);
+ //drawbar(selmon);
+ for(Monitor *m = mons;m;m = m->next){
+ drawbar(m);
+ }
}
void