dwm/patch/bar_tagicons.c

14 lines
377 B
C
Raw Normal View History

2023-12-11 19:16:33 +01:00
char *
tagicon(Monitor *m, int tag)
{
Client *c;
int tagindex = tag + NUMTAGS * m->num;
if (tagindex >= LENGTH(tagicons[DEFAULT_TAGS]))
tagindex = tagindex % LENGTH(tagicons[DEFAULT_TAGS]);
for (c = m->clients; c && (!(c->tags & 1 << tag) || HIDDEN(c)); c = c->next);
if (c)
return tagicons[ALT_TAGS_DECORATION][tagindex];
return tagicons[DEFAULT_TAGS][tagindex];
}