Compare commits

...

2 Commits

5 changed files with 274 additions and 0 deletions

View File

@ -0,0 +1,14 @@
### Description
Add a `window_title` option to toggle showing window titles in the bar, similar to the DWM `notitle` patch.
### Dependencies
this patch depends on [bar](https://codeberg.org/dwl/dwl-patches/src/branch/main/patches/bar/) patch
### Download
- [git branch](/pi66/dwl-patches/src/branch/bar-notitle)
- [0.7](/dwl/dwl-patches/raw/branch/main/patches/bar-notitle/bar-notitle.patch)
- [main 2026-02-28](/dwl/dwl-patches/raw/branch/main/patches/bar-notitle/bar-notitle.patch)
### Authors
- [Pi66](https://codeberg.org/pi66)
[website](https://pi66.xyz)

View File

@ -0,0 +1,38 @@
From 5dc83d75ff1b7dadf1fd1f96fe2303848e35d382 Mon Sep 17 00:00:00 2001
From: pi66 <pixel2176@proton.me>
Date: Sat, 28 Feb 2026 20:26:28 +0100
Subject: [PATCH] add window_title option (like dwm notitle patch)
---
config.def.h | 1 +
dwl.c | 2 +-
2 files changed, 2 insertions(+), 1 deletion(-)
diff --git a/config.def.h b/config.def.h
index 7da50d2..3d3dfe8 100644
--- a/config.def.h
+++ b/config.def.h
@@ -7,6 +7,7 @@
static const int sloppyfocus = 1; /* focus follows mouse */
static const int bypass_surface_visibility = 0; /* 1 means idle inhibitors will disable idle tracking even if it's surface isn't visible */
static const unsigned int borderpx = 1; /* border pixel of windows */
+static const int window_title = 0; /* 1 means showing window titles on the bar */
static const int showbar = 1; /* 0 means no bar */
static const int topbar = 1; /* 0 means bottom bar */
static const char *fonts[] = {"monospace:size=10"};
diff --git a/dwl.c b/dwl.c
index 7fe9468..0c7262a 100644
--- a/dwl.c
+++ b/dwl.c
@@ -1614,7 +1614,7 @@ drawbar(Monitor *m)
x = drwl_text(m->drw, x, 0, w, m->b.height, m->lrpad / 2, m->ltsymbol, 0);
if ((w = m->b.width - tw - x) > m->b.height) {
- if (c) {
+ if (c && window_title) {
drwl_setscheme(m->drw, colors[m == selmon ? SchemeSel : SchemeNorm]);
drwl_text(m->drw, x, 0, w, m->b.height, m->lrpad / 2, client_get_title(c), 0);
if (c && c->isfloating)
--
2.52.0

View File

@ -0,0 +1,37 @@
### Reorganize Tags
Implements the functionality of the reorganize tags patch in the dwm patch.
From the dwm patch:
> Shifts all clients per tag to leftmost unoccupied tags.
> For example, if clients A, B, C are tagged on tags 1, 5, 9 respectively, when
> this function is called, they will now be on 1, 2, and 3. The focused client
> will also remain focused.
> Clients on multiple tags will be treated as if they only were only on their
> leftmost tag, and will be reduced to one tag after the operation is complete.
#### Distribute Tags
> This provides an additional feature to distribute the clients through
> the tags as evenly as possible.
> (The tags are filled left-to-right, looping back if necessary.)
> Eg, if there are 9 clients and 9 tags then each tag will have one
> client. If there are 19 clients, then 3 will be tagged onto tag 1, and
> 2 will be tagged onto each of tags 2 to 9.
### Download
- [main 2026-03-25](/dwl/dwl-patches/raw/branch/rmain/patches/reorganizetags/reorganizetags.patch)
- [with bar patch](/dwl/dwl-patches/raw/branch/rmain/patches/reorganizetags/reorganizetags-bar.patch)
With the bar patch, it will be necessary to replace `TAGCOUNT` with `LENGTH(tags)`. This is done in a separate patch.
### Authors
- [zoigmant](codeberg.org/zoigmant)
### Credits (Authors of the dwm patch)
- [Paul Baldaray](paulbaldaray@gmail.com)
- [kleinbottle4](kleinbottle4@gmail.com)

View File

@ -0,0 +1,93 @@
From ec0ff716f4096e8552c0d142e41a36468c65ed1d Mon Sep 17 00:00:00 2001
From: zoigmant <zoigmant@noreply.codeberg.org>
Date: Sun, 29 Mar 2026 18:08:04 -0700
Subject: [PATCH] [PATCH] reorganize tags patch. Mostly imported from dwm.
Allows the users to move occupied tags as far left as possible. Patched to
accomodate the bar patch
---
config.def.h | 1 +
dwl.c | 48 ++++++++++++++++++++++++++++++++++++++++++++++++
2 files changed, 49 insertions(+)
diff --git a/config.def.h b/config.def.h
index 7da50d2..70c36dd 100644
--- a/config.def.h
+++ b/config.def.h
@@ -136,6 +136,7 @@ static const Key keys[] = {
{ MODKEY, XKB_KEY_d, incnmaster, {.i = -1} },
{ MODKEY, XKB_KEY_h, setmfact, {.f = -0.05f} },
{ MODKEY, XKB_KEY_l, setmfact, {.f = +0.05f} },
+ { MODKEY, XKB_KEY_r, reorganizetags, {0} },
{ MODKEY, XKB_KEY_Return, zoom, {0} },
{ MODKEY, XKB_KEY_Tab, view, {0} },
{ MODKEY|WLR_MODIFIER_SHIFT, XKB_KEY_c, killclient, {0} },
diff --git a/dwl.c b/dwl.c
index 7b2abf5..4d80bd6 100644
--- a/dwl.c
+++ b/dwl.c
@@ -346,6 +346,7 @@ static void pointerfocus(Client *c, struct wlr_surface *surface,
double sx, double sy, uint32_t time);
static void powermgrsetmode(struct wl_listener *listener, void *data);
static void quit(const Arg *arg);
+static void reorganizetags(const Arg *arg);
static void rendermon(struct wl_listener *listener, void *data);
static void requestdecorationmode(struct wl_listener *listener, void *data);
static void requeststartdrag(struct wl_listener *listener, void *data);
@@ -2405,6 +2406,53 @@ requestmonstate(struct wl_listener *listener, void *data)
updatemons(NULL, NULL);
}
+void
+reorganizetags(const Arg *arg) {
+ Client *c;
+ unsigned int occ, unocc, i;
+ unsigned int tagdest[LENGTH(tags)];
+ for (i = 0; i < LENGTH(tags); i++)
+ tagdest[i] = 0; /* so no uninitialized memory warning */
+
+ occ = 0;
+ wl_list_for_each(c, &clients, link) {
+ if ((c->mon == selmon) && c->tags) {
+ for(i = 0;; i++) { /* because no ffs() in this C standard */
+ if ((c->tags) & (1 << i)) {
+ occ |= (1 << i);
+ break;
+ }
+ }
+ }
+ }
+ unocc = 0;
+ for (i = 0; i < LENGTH(tags); ++i) {
+ while (unocc < i && (occ & (1 << unocc)))
+ unocc++;
+ if (occ & (1 << i)) {
+ tagdest[i] = unocc;
+ occ &= ~(1 << i);
+ occ |= 1 << unocc;
+ }
+ }
+
+ wl_list_for_each(c, &clients, link) {
+ if ((c->mon == selmon) && c->tags) {
+ for(i = 0;; i++) {
+ if ((c->tags) & (1 << i)) {
+ c->tags = 1 << tagdest[i];
+ break;
+ }
+ }
+ }
+ }
+ if (focustop(selmon))
+ selmon->tagset[selmon->seltags] = focustop(selmon)->tags;
+ focusclient(focustop(selmon), 1);
+ drawbars();
+ arrange(selmon);
+}
+
void
resize(Client *c, struct wlr_box geo, int interact)
{
--
2.52.0

View File

@ -0,0 +1,92 @@
From c7efef1814c12b8f10de1c32568eaf9241e8518d Mon Sep 17 00:00:00 2001
From: zoigmant <zoigmant@noreply.codeberg.org>
Date: Wed, 25 Mar 2026 15:10:30 -0700
Subject: [PATCH] [PATCH] reorganizetags patch. Mostly imported from dwm.
Allows the users to move occupied tags over so as to remove empty tags
inbetween occupied tags. It preserves the order of the tags.
---
config.def.h | 1 +
dwl.c | 47 +++++++++++++++++++++++++++++++++++++++++++++++
2 files changed, 48 insertions(+)
diff --git a/config.def.h b/config.def.h
index 8a6eda0..12f6d92 100644
--- a/config.def.h
+++ b/config.def.h
@@ -129,6 +129,7 @@ static const Key keys[] = {
{ MODKEY, XKB_KEY_d, incnmaster, {.i = -1} },
{ MODKEY, XKB_KEY_h, setmfact, {.f = -0.05f} },
{ MODKEY, XKB_KEY_l, setmfact, {.f = +0.05f} },
+ { MODKEY, XKB_KEY_r, reorganizetags, {0} },
{ MODKEY, XKB_KEY_Return, zoom, {0} },
{ MODKEY, XKB_KEY_Tab, view, {0} },
{ MODKEY|WLR_MODIFIER_SHIFT, XKB_KEY_c, killclient, {0} },
diff --git a/dwl.c b/dwl.c
index 44f3ad9..8ea1345 100644
--- a/dwl.c
+++ b/dwl.c
@@ -313,6 +313,7 @@ static void pointerfocus(Client *c, struct wlr_surface *surface,
static void printstatus(void);
static void powermgrsetmode(struct wl_listener *listener, void *data);
static void quit(const Arg *arg);
+static void reorganizetags(const Arg *arg);
static void rendermon(struct wl_listener *listener, void *data);
static void requestdecorationmode(struct wl_listener *listener, void *data);
static void requeststartdrag(struct wl_listener *listener, void *data);
@@ -2202,6 +2203,52 @@ requestmonstate(struct wl_listener *listener, void *data)
updatemons(NULL, NULL);
}
+void
+reorganizetags(const Arg *arg) {
+ Client *c;
+ unsigned int occ, unocc, i;
+ unsigned int tagdest[TAGCOUNT];
+ for (i = 0; i < TAGCOUNT; i++)
+ tagdest[i] = 0; /* so no uninitialized memory warning */
+
+ occ = 0;
+ wl_list_for_each(c, &clients, link) {
+ if ((c->mon == selmon) && c->tags) {
+ for(i = 0;; i++) { /* because no ffs() in this C standard */
+ if ((c->tags) & (1 << i)) {
+ occ |= (1 << i);
+ break;
+ }
+ }
+ }
+ }
+ unocc = 0;
+ for (i = 0; i < TAGCOUNT; ++i) {
+ while (unocc < i && (occ & (1 << unocc)))
+ unocc++;
+ if (occ & (1 << i)) {
+ tagdest[i] = unocc;
+ occ &= ~(1 << i);
+ occ |= 1 << unocc;
+ }
+ }
+
+ wl_list_for_each(c, &clients, link) {
+ if ((c->mon == selmon) && c->tags) {
+ for(i = 0;; i++) {
+ if ((c->tags) & (1 << i)) {
+ c->tags = 1 << tagdest[i];
+ break;
+ }
+ }
+ }
+ }
+ if (focustop(selmon))
+ selmon->tagset[selmon->seltags] = focustop(selmon)->tags;
+ focusclient(focustop(selmon), 1);
+ arrange(selmon);
+}
+
void
resize(Client *c, struct wlr_box geo, int interact)
{
--
2.52.0