Do not display empty tag names
This commit is contained in:
parent
ff87856a4e
commit
79cf5d8324
9
dwm.c
9
dwm.c
|
@ -1482,6 +1482,7 @@ movemouse(const Arg *arg)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// TODO: this function really needs to be refactored
|
||||||
void
|
void
|
||||||
nametag(const Arg *arg) {
|
nametag(const Arg *arg) {
|
||||||
char *p, name[MAX_TAGNAME_LEN];
|
char *p, name[MAX_TAGNAME_LEN];
|
||||||
|
@ -1502,11 +1503,17 @@ nametag(const Arg *arg) {
|
||||||
if((p = strchr(name, '\n')))
|
if((p = strchr(name, '\n')))
|
||||||
*p = '\0';
|
*p = '\0';
|
||||||
|
|
||||||
for(i = 0; i < LENGTH(tags); i++)
|
for (i = 0; i < LENGTH(tags); ++i) {
|
||||||
if (selmon->tagset[selmon->seltags] & (1 << i)) {
|
if (selmon->tagset[selmon->seltags] & (1 << i)) {
|
||||||
|
if (name[0] == '\0') {
|
||||||
|
sprintf(tags[i], "%d", i + 1);
|
||||||
|
} else {
|
||||||
sprintf(tags[i], TAG_PREPEND, i + 1);
|
sprintf(tags[i], TAG_PREPEND, i + 1);
|
||||||
strcat(tags[i], name);
|
strcat(tags[i], name);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
drawbars();
|
drawbars();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue