diff options
| author | Fuwn <[email protected]> | 2024-01-08 20:07:52 -0800 |
|---|---|---|
| committer | Fuwn <[email protected]> | 2024-01-08 20:07:52 -0800 |
| commit | 8ea165040b479cdd927317aa1a4c596d8b88dd49 (patch) | |
| tree | db287149f0a220b5779f754e8a0a7bb993be31b1 | |
| parent | fix(dwm.c): clear name to original (diff) | |
| download | seiwm-8ea165040b479cdd927317aa1a4c596d8b88dd49.tar.xz seiwm-8ea165040b479cdd927317aa1a4c596d8b88dd49.zip | |
feat(dwm.c): append mode for nametag
| -rw-r--r-- | config.h | 4 | ||||
| -rw-r--r-- | dwm.c | 14 |
2 files changed, 13 insertions, 5 deletions
@@ -79,6 +79,10 @@ static Sp scratchpads[] = { #define TAGS \ { "一", "二", "三", "四", "五", "六", "七", "八", "九" } static char tags[][MAX_TAGLEN] = TAGS; +/* append_nametag: + * 1: append the new nametag to the original tag label from above + * 0: overwrite original tag label with new nametag */ +static const unsigned int append_nametag = 1; static const Rule rules[] = { /* xprop(1): @@ -1813,13 +1813,17 @@ void nametag(const Arg *arg) { for (i = 0; i < LENGTH(tags); i++) if (selmon->tagset[selmon->seltags] & (1 << i)) { - strcpy(tags[i], tags_original[i]); + if (append_nametag == 1) { + strcpy(tags[i], tags_original[i]); - if (strlen(name) != 0) - strcat(tags[i], " "); + if (strlen(name) != 0) + strcat(tags[i], " "); - sprintf(tags[i], TAG_PREPEND, tags[i]); - strcat(tags[i], name); + sprintf(tags[i], TAG_PREPEND, tags[i]); + strcat(tags[i], name); + } else { + strcpy(tags[i], name); + } } drawbars(); } |