From 8a3694b5886fae51af1ede8689fee43f961b86e4 Mon Sep 17 00:00:00 2001 From: Kerberoge Date: Tue, 6 Aug 2024 14:52:09 +0200 Subject: [PATCH] Rebased barcolors patch onto 0.7 --- patches/barcolors/README.md | 11 ++++------- patches/barcolors/barcolors.patch | 25 +++++++++++++------------ 2 files changed, 17 insertions(+), 19 deletions(-) diff --git a/patches/barcolors/README.md b/patches/barcolors/README.md index 1075892..b1a64ca 100644 --- a/patches/barcolors/README.md +++ b/patches/barcolors/README.md @@ -1,12 +1,9 @@ ### Description -Adds support for colored status text. Text can be colored in the same manner as with dwlb, namely by wrapping it between `^fg(color)` and `^fg()` or `^bg(color)` and `^bg()`, where `color` is a 6-digit hexadecimal value. This patch only works if the bar patch has been applied before. +Add support for colored status text to the [bar](/dwl/dwl-patches/wiki/bar). Text can be colored in the same manner as with dwlb, namely by wrapping it between `^fg(color)` and `^fg()` or `^bg(color)` and `^bg()`, where `color` is a 6-digit hexadecimal value. ### Download -- [git branch](https://codeberg.org/kerberoge/dwl/src/branch/barcolors) -- [2024-07-28](https://codeberg.org/dwl/dwl-patches/raw/branch/main/patches/barcolors/barcolors.patch) +- [git branch](/kerberoge/dwl/src/branch/barcolors) +- [0.7](/dwl/dwl-patches/raw/branch/main/patches/barcolors/barcolors.patch) ### Authors -- [Kerberoge](https://codeberg.org/kerberoge) - sjoerdenjh@gmail.com - kerberoge at [Libera IRC dwl channel](https://web.libera.chat/?channels=#dwl) - kerberoge at [dwl Discord](https://discord.gg/jJxZnrGPWN) +- [kerberoge](https://codeberg.org/kerberoge) diff --git a/patches/barcolors/barcolors.patch b/patches/barcolors/barcolors.patch index 9761479..6c22621 100644 --- a/patches/barcolors/barcolors.patch +++ b/patches/barcolors/barcolors.patch @@ -1,17 +1,17 @@ -From 14d59d55fe815a081d99db4090febaf69b482ded Mon Sep 17 00:00:00 2001 +From 48802fb29c352edcf77e7c85dca1eed872ccb62a Mon Sep 17 00:00:00 2001 From: Kerberoge -Date: Sun, 28 Jul 2024 13:02:41 +0200 -Subject: [PATCH] Created barcolors patch +Date: Tue, 6 Aug 2024 14:22:23 +0200 +Subject: [PATCH 1/1] Updated barcolors patch --- - dwl.c | 88 +++++++++++++++++++++++++++++++++++++++++++++++++++++++---- - 1 file changed, 82 insertions(+), 6 deletions(-) + dwl.c | 89 +++++++++++++++++++++++++++++++++++++++++++++++++++++++---- + 1 file changed, 83 insertions(+), 6 deletions(-) diff --git a/dwl.c b/dwl.c -index 60f3087..40c094e 100644 +index 8614fdd..551bdcf 100644 --- a/dwl.c +++ b/dwl.c -@@ -313,6 +313,7 @@ static void destroykeyboardgroup(struct wl_listener *listener, void *data); +@@ -312,6 +312,7 @@ static void destroykeyboardgroup(struct wl_listener *listener, void *data); static Monitor *dirtomon(enum wlr_direction dir); static void drawbar(Monitor *m); static void drawbars(void); @@ -19,7 +19,7 @@ index 60f3087..40c094e 100644 static void focusclient(Client *c, int lift); static void focusmon(const Arg *arg); static void focusstack(const Arg *arg); -@@ -443,7 +444,7 @@ static struct wlr_box sgeom; +@@ -442,7 +443,7 @@ static struct wlr_box sgeom; static struct wl_list mons; static Monitor *selmon; @@ -28,7 +28,7 @@ index 60f3087..40c094e 100644 static struct wl_event_source *status_event_source; static const struct wlr_buffer_impl buffer_impl = { -@@ -1480,11 +1481,8 @@ drawbar(Monitor *m) +@@ -1479,11 +1480,8 @@ drawbar(Monitor *m) drwl_prepare_drawing(m->drw, m->b.width, m->b.height, buf->data, stride); /* draw status first so it can be overdrawn by tags later */ @@ -42,7 +42,7 @@ index 60f3087..40c094e 100644 wl_list_for_each(c, &clients, link) { if (c->mon != m) -@@ -1539,6 +1537,84 @@ drawbars(void) +@@ -1538,6 +1536,85 @@ drawbars(void) drawbar(m); } @@ -120,7 +120,8 @@ index 60f3087..40c094e 100644 + } + } + iw = TEXTW(m, itext) - m->lrpad; -+ drwl_text(m->drw, x, 0, iw, m->b.height, 0, itext, 0); ++ if (*itext) ++ drwl_text(m->drw, x, 0, iw, m->b.height, 0, itext, 0); + return tw; +} + @@ -128,5 +129,5 @@ index 60f3087..40c094e 100644 focusclient(Client *c, int lift) { -- -2.45.2 +2.46.0