-
Notifications
You must be signed in to change notification settings - Fork 31
/
Copy pathdwm-tagicons-selected-6.2.diff
55 lines (50 loc) · 1.85 KB
/
dwm-tagicons-selected-6.2.diff
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
From 72e8a4eb0b0cbe2fc5aa5bf809ae407d17f1a640 Mon Sep 17 00:00:00 2001
From: Bakkeby <[email protected]>
Date: Wed, 26 Jun 2024 22:55:32 +0200
Subject: [PATCH 2/2] tagicons with separate icon for selected tags
Example patch ref.
https://www.reddit.com/r/suckless/comments/ln0t41/use_icon_instead_of_rectangle_as/
---
config.def.h | 5 +++--
dwm.c | 5 ++++-
2 files changed, 7 insertions(+), 3 deletions(-)
diff --git a/config.def.h b/config.def.h
index d82e4df..7607155 100644
--- a/config.def.h
+++ b/config.def.h
@@ -21,9 +21,10 @@ static const char *colors[][3] = {
/* tagging: refer to https://github.com/bakkeby/patches/wiki/tagicons */
static const char *tags[NUMTAGS] = { NULL }; /* left for compatibility reasons, i.e. code that checks LENGTH(tags) */
static char *tagicons[][NUMTAGS] = {
- [IconsDefault] = { "1", "2", "3", "4", "5", "6", "7", "8", "9" },
+ [IconsDefault] = { "○" },
[IconsVacant] = { NULL },
- [IconsOccupied] = { NULL },
+ [IconsOccupied] = { "☉" },
+ [IconsSelected] = { "◉" },
};
static const Rule rules[] = {
diff --git a/dwm.c b/dwm.c
index 614a9ef..b28febd 100644
--- a/dwm.c
+++ b/dwm.c
@@ -71,6 +71,7 @@ enum {
IconsDefault,
IconsVacant,
IconsOccupied,
+ IconsSelected,
IconsLast
}; /* icon sets */
@@ -1729,7 +1730,9 @@ tagicon(Monitor *m, int tag)
char *icon;
for (c = m->clients; c && (!(c->tags & 1 << tag)); c = c->next);
// for (c = m->clients; c && (!(c->tags & 1 << tag) || HIDDEN(c)); c = c->next); // awesomebar / wintitleactions compatibility
- if (c && tagicons[IconsOccupied][0] != NULL)
+ if (m->tagset[m->seltags] & 1 << tag && tagicons[IconsSelected][0] != NULL)
+ icon = geticon(m, tag, IconsSelected);
+ else if (c && tagicons[IconsOccupied][0] != NULL)
icon = geticon(m, tag, IconsOccupied);
else {
icon = geticon(m, tag, m->iconset);
--
2.45.2