diff options
| author | Nathan Reiner <nathan@nathanreiner.xyz> | 2023-03-20 21:45:58 +0100 |
|---|---|---|
| committer | Nathan Reiner <nathan@nathanreiner.xyz> | 2023-03-20 21:45:58 +0100 |
| commit | 6ef44e08ae899de2dc9992b5934154856a2b460a (patch) | |
| tree | 7ac6e49ba3cd3b496bb1c9e9f1d8179082605775 | |
| parent | 6139b40ada111015e22a3e5e3a91f83c761ea719 (diff) | |
add client indicator
| -rw-r--r-- | dbar.c | 9 |
1 files changed, 8 insertions, 1 deletions
@@ -12,6 +12,7 @@ #include <fcntl.h> #include <errno.h> #include <sys/inotify.h> +#include <malloc.h> #include "drw.h" #include "util.h" @@ -136,6 +137,8 @@ draw_frame(Bar *bar) draw_font(canvas, font, tag->name, x, height - padding, foreground); } + if (bar->clients & (1 << i)) + draw_rect(canvas, x - padding + 2, 2, 5, 5, foreground); x += padding + w; ++i; @@ -313,7 +316,11 @@ dwl_output_tag(void *data, struct zdwl_output_v1 *zdwl_output_v1, uint32_t tag, bar->urgtag &= ~(1 << tag); } - bar->clients = clients; + if (clients) { + bar->clients |= 1 << tag; + } else { + bar->clients &= ~(1 << tag); + } if (++bar->update_count == bar_state.tags.size) { update_bar(bar); |