commit 1d6ba5093345265203ae1ee5cb3011d8cb16827e
parent e29f19386aca78fce2b96b5475a053594eb66aa3
Author: hhvn <dev@hhvn.uk>
Date: Thu, 14 Apr 2022 12:06:12 +0100
Add divider func
Diffstat:
2 files changed, 14 insertions(+), 0 deletions(-)
diff --git a/dwmbar.h b/dwmbar.h
@@ -21,6 +21,7 @@ void s2d_finish(void);
void s2d_rect(unsigned x, unsigned y, unsigned w, unsigned h);
void s2d_border(unsigned x, unsigned y, unsigned w, unsigned h, unsigned px);
void s2d_bar(unsigned x, unsigned y, unsigned w, unsigned h, unsigned px, unsigned percent);
+void s2d_divider(void);
void s2d_fg(char *fg);
void s2d_bg(char *bg);
void s2d_forward(int px); /* negative to advance past drawn objects */
diff --git a/status2d.c b/status2d.c
@@ -103,6 +103,19 @@ s2d_bar(unsigned x, unsigned y, unsigned w, unsigned h, unsigned px, unsigned pe
free(sbg);
}
+void
+s2d_divider(void) {
+ char *sfg = curfg ? strdup(curfg) : NULL;
+ s2d_fg(BLACK);
+ s2d_forward(5);
+ s2d_rect(0, 0, 1, bar_height);
+ s2d_forward(5);
+ s2d_reset(1, 0);
+ if (sfg)
+ s2d_fg(sfg);
+ free(sfg);
+}
+
static char *
verifyhex(char *hex) {
char *p;