commit 26adfaf98f2e753223515507b486a2218d2e1c18
parent 664b424d78a60b0ad61095aa748dca623bb3af62
Author: Rizqi Nur Assyaufi <bandithijo@gmail.com>
Date: Tue, 24 Jun 2025 23:57:21 +0800
[dwm][patch][bardwmlogo] Add new patch
This patch add dwm logo before tags on the left side of the status bar
for aesthetic or branding purposes.
Diffstat:
3 files changed, 113 insertions(+), 0 deletions(-)
diff --git a/dwm.suckless.org/patches/bardwmlogo/bardwmlogo_1.png b/dwm.suckless.org/patches/bardwmlogo/bardwmlogo_1.png
Binary files differ.
diff --git a/dwm.suckless.org/patches/bardwmlogo/dwm-bardwmlogo-6.5.diff b/dwm.suckless.org/patches/bardwmlogo/dwm-bardwmlogo-6.5.diff
@@ -0,0 +1,90 @@
+From 22f1116ed0d9a499a73394eb42f1e0d51fd4f2fc Mon Sep 17 00:00:00 2001
+From: Rizqi Nur Assyaufi <bandithijo@gmail.com>
+Date: Tue, 24 Jun 2025 22:56:04 +0800
+Subject: [PATCH] Add DWM logo on left bar before tags
+
+This patch add dwm logo before tags on the left side of the status bar for
+aesthetic or branding purposes.
+
+The logo renders using several ractangels to form the characters "dwm" in a
+pixel-art style.
+---
+ dwm.c | 34 +++++++++++++++++++++++++++++++++-
+ 1 file changed, 33 insertions(+), 1 deletion(-)
+
+diff --git a/dwm.c b/dwm.c
+index f1d86b2..0bef187 100644
+--- a/dwm.c
++++ b/dwm.c
+@@ -141,6 +141,10 @@ typedef struct {
+ int monitor;
+ } Rule;
+
++typedef struct {
++ int x, y, w, h;
++} DwmLogo;
++
+ /* function declarations */
+ static void applyrules(Client *c);
+ static int applysizehints(Client *c, int *x, int *y, int *w, int *h, int interact);
+@@ -241,6 +245,7 @@ static int screen;
+ static int sw, sh; /* X display screen geometry width, height */
+ static int bh; /* bar height */
+ static int lrpad; /* sum of left and right padding for text */
++static int dwmlogowdth = 54; /* dwm logo width */
+ static int (*xerrorxlib)(Display *, XErrorEvent *);
+ static unsigned int numlockmask = 0;
+ static void (*handler[LASTEvent]) (XEvent *) = {
+@@ -433,6 +438,7 @@ buttonpress(XEvent *e)
+ }
+ if (ev->window == selmon->barwin) {
+ i = x = 0;
++ x = dwmlogowdth; /* dwm logo width */
+ do
+ x += TEXTW(tags[i]);
+ while (ev->x >= x && ++i < LENGTH(tags));
+@@ -699,6 +705,7 @@ void
+ drawbar(Monitor *m)
+ {
+ int x, w, tw = 0;
++ int stroke = 4, letterHeight = bh - 4;
+ int boxs = drw->fonts->h / 9;
+ int boxw = drw->fonts->h / 6 + 2;
+ unsigned int i, occ = 0, urg = 0;
+@@ -719,7 +726,32 @@ drawbar(Monitor *m)
+ if (c->isurgent)
+ urg |= c->tags;
+ }
+- x = 0;
++
++ /* use colored scheme for visibility */
++ drw_setscheme(drw, scheme[SchemeNorm]);
++
++ /* draw dark background for logo */
++ drw_rect(drw, 0, 0, dwmlogowdth, bh, 1, 1);
++
++ /* draw dwm logo */
++ const DwmLogo dwmLogo[] = {
++ { 0, 9, stroke, letterHeight / 2 }, /* d: left vertical */
++ { 0, 15, 35, stroke }, /* d: bottom horizontal */
++ { 13, 1, stroke, letterHeight }, /* d: right vertical */
++ { 0, 7, 15, stroke }, /* d: top horizontal */
++ { 22, 7, stroke, letterHeight / 2 }, /* w: center vertical */
++ { 31, 7, stroke, letterHeight / 2 }, /* w: right vertical */
++ { 31, 7, 22, stroke }, /* m: top horizontal */
++ { 40, 11, stroke, letterHeight / 2 }, /* m: center vertical */
++ { 49, 11, stroke, letterHeight / 2 } /* m: right vertical */
++ };
++
++ for (int i = 0; i < LENGTH(dwmLogo); i++) {
++ drw_rect(drw, dwmLogo[i].x, dwmLogo[i].y, dwmLogo[i].w, dwmLogo[i].h, 1, 0);
++ }
++
++ /* start drawing tags after logo */
++ x = dwmlogowdth;
+ for (i = 0; i < LENGTH(tags); i++) {
+ w = TEXTW(tags[i]);
+ drw_setscheme(drw, scheme[m->tagset[m->seltags] & 1 << i ? SchemeSel : SchemeNorm]);
+--
+2.50.0
+
diff --git a/dwm.suckless.org/patches/bardwmlogo/index.md b/dwm.suckless.org/patches/bardwmlogo/index.md
@@ -0,0 +1,23 @@
+bardwmlogo
+==========
+
+Description
+-----------
+This patch add dwm logo before tags on the left side of the status bar for aesthetic or branding purposes.
+
+* Introduces a new `DwmLogo` struct to store rectangle dimensions for the logo's strokes.
+* Defines a fixed logo width (`dwmlogowdth = 54`) and shifts tag drawing accordingly to avoid overlap.
+* Draws a dark background rectangle to distinguish the logo area visually.
+* Renders the logo using several rectangles `drw_rect()` to form the characters "dwm" in a pixel-art style.
+
+This patch is entirely visual and does not affect DWM's core functionality or performance. It can be useful for users who want a more personalized or distinctive look to their window manager.
+
+
+
+Download
+--------
+* [dwm-bardwmlogo-6.5.diff](dwm-bardwmlogo-6.5.diff) (2024-03-19)
+
+Authors
+-------
+* Rizqi Nur Assyaufi - <bandithijo@gmail.com> (6.5)