feat: nerd font tag names offset
This commit is contained in:
parent
bb0af060e5
commit
88bd704613
2 changed files with 4 additions and 2 deletions
1
config.h
1
config.h
|
@ -34,6 +34,7 @@ static const unsigned int alphas[][3] = {
|
|||
};
|
||||
|
||||
/* tagging */
|
||||
static const unsigned int nerdfont_icons = (1 << 8) | (1 << 7);
|
||||
static const char *tags[] = { "1", "2", "3", "4", "5", "6", "7", "", "" };
|
||||
static const char *metaworkspaces[] = { "1", "2", "3", "4" };
|
||||
|
||||
|
|
5
dwm.c
5
dwm.c
|
@ -62,6 +62,7 @@
|
|||
#define HEIGHT(X) ((X)->h + 2 * (X)->bw)
|
||||
#define TAGMASK ((1 << LENGTH(tags)) - 1)
|
||||
#define TEXTW(X) (drw_fontset_getwidth(drw, (X)) + lrpad)
|
||||
#define TEXTWN(X) (drw_fontset_getwidth(drw, (X)) + lrpad+6)
|
||||
#define OPAQUE 0xffU
|
||||
|
||||
/* enums */
|
||||
|
@ -552,7 +553,7 @@ buttonpress(XEvent *e)
|
|||
do {
|
||||
if (!(occ & 1 << i || m->tagset[m->seltags] & 1 << i))
|
||||
continue;
|
||||
x += TEXTW(tags[i]);
|
||||
x += (1 << i) & nerdfont_icons ? TEXTWN(tags[i]) : TEXTW(tags[i]);
|
||||
} while (ev->x >= x && ++i < LENGTH(tags));
|
||||
|
||||
if (ev->x < TEXTW(mwsymbol))
|
||||
|
@ -855,7 +856,7 @@ drawbar(Monitor *m)
|
|||
for (i = 0; i < LENGTH(tags); i++) {
|
||||
if(!(occ & 1 << i || m->tagset[m->seltags] & 1 << i))
|
||||
continue;
|
||||
w = TEXTW(tags[i]);
|
||||
w = (1 << i) & nerdfont_icons ? TEXTWN(tags[i]) : TEXTW(tags[i]);
|
||||
drw_setscheme(drw, scheme[m->tagset[m->seltags] & 1 << i ? SchemeSel : SchemeNorm]);
|
||||
drw_text(drw, x, 0, w, bh, lrpad / 2, tags[i], urg & 1 << i);
|
||||
if (occ & 1 << i && m == selmon &&
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue