Add different tags icons for Monitor 0

This commit is contained in:
Przemek Grondek 2023-03-20 12:39:49 +01:00
parent e3173ac946
commit 5cc0f6e86a
2 changed files with 16 additions and 18 deletions

View File

@ -51,24 +51,24 @@ static const Rule rules[] = {
* WM_NAME(STRING) = title
*/
/* class instance title tags mask isfloating isfakefullscreen isterminal noswallow ignoretransient monitor */
{"jetbrains-studio", NULL, NULL, 0, 1, 0, 0, 0, 0, -1},
{"st", NULL, NULL, 0, 0, 0, 1, 1, 0, -1},
{"Xephyr", NULL, NULL, 0, 1, 0, 0, 0, 0, -1},
{"Xnest", NULL, NULL, 0, 1, 0, 0, 0, 0, -1},
{"streamdeck", NULL, NULL, 0, 0, 0, 0, 1, 0, -1},
{"firefox", NULL, "Picture-in-Picture", DWM_ALL_TAGS,1, 0, 0, 0, 0, -1},
/* Tag 1  */
{"firefox", NULL, "YouTube", 1 << 0, 0, 0, 0, 0, 0, 1},
{"firefox", NULL, "Twitch", 1 << 0, 0, 0, 0, 0, 0, 1},
{"firefox", NULL, "YouTube", 1 << 0, 0, 1, 0, 0, 0, 1},
{"firefox", NULL, "Twitch", 1 << 0, 0, 1, 0, 0, 0, 1},
{"firefox", NULL, NULL, 1 << 0, 0, 1, 0, 0, 0, -1},
/* Tag 2  */
{"jetbrains-toolbox", NULL, NULL, 1 << 1, 1, 0, 0, 1, 0, -1},
{"jetbrains-idea", NULL, NULL, 1 << 1, 0, 0, 0, 1, 1, -1},
{"jetbrains-studio", NULL, NULL, 1 << 1, 0, 0, 0, 1, 1, -1},
{"jetbrains-webstorm", NULL, NULL, 1 << 1, 0, 0, 0, 1, 1, -1},
{"jetbrains-clion", NULL, NULL, 1 << 1, 0, 0, 0, 1, 1, -1},
{"jetbrains-pycharm", NULL, NULL, 1 << 1, 0, 0, 0, 1, 1, -1},
{"jetbrains-idea", NULL, "Welcome to IntelliJ IDEA", 1 << 1, 1, 0, 0, 1, 0, -1},
{"jetbrains-studio", NULL, NULL, 1 << 1, 1, 0, 0, 0, 0, 0},
{"jetbrains-toolbox", NULL, NULL, 1 << 1, 1, 0, 0, 1, 0, 0},
{"jetbrains-idea", NULL, NULL, 1 << 1, 0, 0, 0, 1, 1, 0},
{"jetbrains-studio", NULL, NULL, 1 << 1, 0, 0, 0, 1, 1, 0},
{"jetbrains-webstorm", NULL, NULL, 1 << 1, 0, 0, 0, 1, 1, 0},
{"jetbrains-clion", NULL, NULL, 1 << 1, 0, 0, 0, 1, 1, 0},
{"jetbrains-pycharm", NULL, NULL, 1 << 1, 0, 0, 0, 1, 1, 0},
{"jetbrains-idea", NULL, "Welcome to IntelliJ IDEA", 1 << 1, 1, 0, 0, 1, 0, 0},
/* Tag 3  */
{ "Cider", NULL, NULL, 1 << 2, 0, 0, 0, 0, 0, -1},
/* Tag 4  */

14
dwm.c
View File

@ -554,9 +554,10 @@ buttonpress(XEvent *e)
focus(NULL);
}
if (ev->window == selmon->barwin) {
i = x = 0;
const char **tags_ = m->num==0 ? tags0 : tags;
i = x = 0;
do
x += TEXTW(tags[i]);
x += TEXTW(tags_[i]);
while (ev->x >= x && ++i < LENGTH(tags));
if (i < LENGTH(tags)) {
click = ClkTagBar;
@ -928,14 +929,11 @@ drawbar(Monitor *m)
urg |= c->tags;
}
x = 0;
const char **tags_ = m->num==0 ? tags0 : tags;
for (i = 0; i < LENGTH(tags); i++) {
w = TEXTW(tags[i]);
w = TEXTW(tags_[i]);
drw_setscheme(drw, scheme[m->tagset[m->seltags] & 1 << i ? SchemeSel : SchemeNorm]);
if(m->num == 0){
drw_text(drw, x, 0, w, bh, lrpad / 2, tags0[i], urg & 1 << i);
} else {
drw_text(drw, x, 0, w, bh, lrpad / 2, tags[i], urg & 1 << i);
}
drw_text(drw, x, 0, w, bh, lrpad / 2, tags_[i], urg & 1 << i);
if (occ & 1 << i)
drw_rect(drw, x + boxs, boxs, boxw, boxw,
m == selmon && selmon->sel && selmon->sel->tags & 1 << i,