From a86c3b9239cd3aa7aa35800c9c21e616eb7b8907 Mon Sep 17 00:00:00 2001 From: sewn Date: Tue, 28 May 2024 13:26:36 +0300 Subject: [PATCH] bar: 2024-05-28 --- patches/bar/README.md | 2 +- patches/bar/bar.patch | 41 ++++++++++++++++++++++++----------------- 2 files changed, 25 insertions(+), 18 deletions(-) diff --git a/patches/bar/README.md b/patches/bar/README.md index 769e75f..02413ca 100644 --- a/patches/bar/README.md +++ b/patches/bar/README.md @@ -14,7 +14,7 @@ slstatus -s | dwl ### Download - [git branch](https://codeberg.org/sewn/dwl/src/branch/bar) -- [2024-04-25](https://codeberg.org/dwl/dwl-patches/raw/branch/main/patches/bar/bar.patch) +- [2024-05-28](https://codeberg.org/dwl/dwl-patches/raw/branch/main/patches/bar/bar.patch) Below is a preview of the barpadding and barborder patches applied. diff --git a/patches/bar/bar.patch b/patches/bar/bar.patch index 21ee65a..ff36dc5 100644 --- a/patches/bar/bar.patch +++ b/patches/bar/bar.patch @@ -1,6 +1,6 @@ -From 593e4ce9d4695d48c4da10560fca15251ec265ac Mon Sep 17 00:00:00 2001 +From a53e23e1fe72e46eac00c428360b7ce679eadb4b Mon Sep 17 00:00:00 2001 From: sewn -Date: Thu, 25 Apr 2024 17:51:28 +0300 +Date: Tue, 28 May 2024 13:25:00 +0300 Subject: [PATCH] Implement dwm bar clone --- @@ -295,7 +295,7 @@ index 0000000..613551e + return x + (render ? w : 0); +} diff --git a/dwl.c b/dwl.c -index bf763df..2145e55 100644 +index bf763df..0268772 100644 --- a/dwl.c +++ b/dwl.c @@ -4,6 +4,7 @@ @@ -596,7 +596,7 @@ index bf763df..2145e55 100644 /* The xdg-protocol specifies: * -@@ -1233,6 +1341,99 @@ dirtomon(enum wlr_direction dir) +@@ -1233,6 +1341,98 @@ dirtomon(enum wlr_direction dir) return selmon; } @@ -666,15 +666,14 @@ index bf763df..2145e55 100644 + if ((w = mon->b.width - tw - x) > mon->b.height) { + if (c != NULL) { + drwl_text(pix, font, x, 0, w, mon->b.height, lrpad / 2, -+ c ? client_get_title(c) : NULL, ++ client_get_title(c), + mon == selmon ? &selbarfg : &normbarfg, + (mon == selmon && c) ? &selbarbg : &normbarbg); + if (c && c->isfloating) + drwl_rect(pix, x + boxs, boxs, boxw, boxw, 0, + mon == selmon ? &selbarfg : &normbarfg); -+ } else { ++ } else + drwl_rect(pix, x, 0, w, mon->b.height, 1, &normbarbg); -+ } + } + + pixman_image_unref(pix); @@ -696,7 +695,7 @@ index bf763df..2145e55 100644 void focusclient(Client *c, int lift) { -@@ -1290,7 +1491,7 @@ focusclient(Client *c, int lift) +@@ -1290,7 +1490,7 @@ focusclient(Client *c, int lift) client_activate_surface(old, 0); } } @@ -705,7 +704,7 @@ index bf763df..2145e55 100644 if (!c) { /* With no client, all we have left is to clear focus */ -@@ -1618,7 +1819,7 @@ mapnotify(struct wl_listener *listener, void *data) +@@ -1618,7 +1818,7 @@ mapnotify(struct wl_listener *listener, void *data) } else { applyrules(c); } @@ -714,7 +713,7 @@ index bf763df..2145e55 100644 unset_fullscreen: m = c->mon ? c->mon : xytomon(c->geom.x, c->geom.y); -@@ -1904,46 +2105,6 @@ pointerfocus(Client *c, struct wlr_surface *surface, double sx, double sy, +@@ -1904,46 +2104,6 @@ pointerfocus(Client *c, struct wlr_surface *surface, double sx, double sy, wlr_seat_pointer_notify_motion(seat, time, sx, sy); } @@ -761,7 +760,7 @@ index bf763df..2145e55 100644 void quit(const Arg *arg) -@@ -2074,23 +2235,14 @@ run(char *startup_cmd) +@@ -2074,23 +2234,14 @@ run(char *startup_cmd) /* Now that the socket exists and the backend is started, run the startup command */ if (startup_cmd) { @@ -786,7 +785,7 @@ index bf763df..2145e55 100644 /* At this point the outputs are initialized, choose initial selmon based on * cursor position, and set default cursor image */ -@@ -2155,7 +2307,7 @@ setfloating(Client *c, int floating) +@@ -2155,7 +2306,7 @@ setfloating(Client *c, int floating) (p && p->isfullscreen) ? LyrFS : c->isfloating ? LyrFloat : LyrTile]); arrange(c->mon); @@ -795,7 +794,7 @@ index bf763df..2145e55 100644 } void -@@ -2178,7 +2330,7 @@ setfullscreen(Client *c, int fullscreen) +@@ -2178,7 +2329,7 @@ setfullscreen(Client *c, int fullscreen) resize(c, c->prev, 0); } arrange(c->mon); @@ -804,7 +803,7 @@ index bf763df..2145e55 100644 } void -@@ -2203,7 +2355,7 @@ setlayout(const Arg *arg) +@@ -2203,7 +2354,7 @@ setlayout(const Arg *arg) selmon->lt[selmon->sellt] = (Layout *)arg->v; strncpy(selmon->ltsymbol, selmon->lt[selmon->sellt]->symbol, LENGTH(selmon->ltsymbol)); arrange(selmon); @@ -813,11 +812,11 @@ index bf763df..2145e55 100644 } /* arg > 1.0 will set mfact absolutely */ -@@ -2506,6 +2658,17 @@ setup(void) +@@ -2506,6 +2657,17 @@ setup(void) wlr_scene_set_presentation(scene, wlr_presentation_create(dpy, backend)); -+ fcft_init(FCFT_LOG_COLORIZE_AUTO, 0, FCFT_LOG_CLASS_DEBUG); ++ fcft_init(FCFT_LOG_COLORIZE_AUTO, 0, FCFT_LOG_CLASS_ERROR); + fcft_set_scaling_filter(FCFT_SCALING_FILTER_LANCZOS3); + if (!(font = fcft_from_name(LENGTH(fonts), fonts, fontattrs))) + die("Could not load font"); @@ -831,6 +830,14 @@ index bf763df..2145e55 100644 /* Make sure XWayland clients don't connect to the parent X server, * e.g when running in the x11 backend or the wayland backend and the * compositor has Xwayland support */ +@@ -2530,6 +2692,7 @@ void + spawn(const Arg *arg) + { + if (fork() == 0) { ++ close(STDIN_FILENO); + dup2(STDERR_FILENO, STDOUT_FILENO); + setsid(); + execvp(((char **)arg->v)[0], (char **)arg->v); @@ -2548,6 +2711,30 @@ startdrag(struct wl_listener *listener, void *data) LISTEN_STATIC(&drag->icon->events.destroy, destroydragicon); } @@ -1001,5 +1008,5 @@ index bf763df..2145e55 100644 if (c->isurgent && surface && surface->mapped) client_set_border_color(c, urgentcolor); -- -2.44.0 +2.45.0