diff --git a/patches/centertitle/README.md b/patches/bartruecenteredtitle/README.md similarity index 50% rename from patches/centertitle/README.md rename to patches/bartruecenteredtitle/README.md index 8148a88..1b416f6 100644 --- a/patches/centertitle/README.md +++ b/patches/bartruecenteredtitle/README.md @@ -1,9 +1,9 @@ ### Description A homegrown port of dwm's _truecenteredtitle_ patch, with the addition of a config option to toggle its effects.
Requires [the bar patch](https://codeberg.org/dwl/dwl-patches/src/branch/main/patches/bar) to be applied beforehand. -![](centertitle.webp) +![](centeredtitle.webp) ### Download -- [v0.7](/dwl/dwl-patches/raw/branch/main/patches/centertitle/centertitle-v0.7.patch)
Targets latest dwl release v0.7. +- [v0.7](/dwl/dwl-patches/raw/branch/main/patches/bartruecenteredtitle/bar-truecenteredtitle-v0.7.patch)
Targets latest dwl release v0.7. ### Author -- [Codeberg: moonsabre](https://codeberg.org/moonsabre)
[Discord: moonsabre.](https://discordapp.com/users/1334621003648733274) +- [moonsabre](https://codeberg.org/moonsabre) diff --git a/patches/centertitle/centertitle-v0.7.patch b/patches/bartruecenteredtitle/bar-truecenteredtitle-v0.7.patch similarity index 92% rename from patches/centertitle/centertitle-v0.7.patch rename to patches/bartruecenteredtitle/bar-truecenteredtitle-v0.7.patch index 6395cc0..dcf0dbc 100644 --- a/patches/centertitle/centertitle-v0.7.patch +++ b/patches/bartruecenteredtitle/bar-truecenteredtitle-v0.7.patch @@ -16,7 +16,7 @@ index 5d1dc2b..ecbf223 100644 static const unsigned int borderpx = 1; /* border pixel of windows */ static const int showbar = 1; /* 0 means no bar */ static const int topbar = 1; /* 0 means bottom bar */ -+static const int centertitle = 1; /* 1 means center window title */ ++static const int centeredtitle = 1; /* 1 means center window title */ static const char *fonts[] = {"monospace:size=10"}; static const float rootcolor[] = COLOR(0x000000ff); /* This conforms to the xdg-protocol. Set the alpha to zero to restore the old behavior */ @@ -29,7 +29,7 @@ index ece537a..d7ffce2 100644 if (c) { 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 ((centertitle == 0) || (TEXTW(selmon, client_get_title(c)) > w)) { ++ if ((centeredtitle == 0) || (TEXTW(selmon, client_get_title(c)) > w)) { + drwl_text(m->drw, x, 0, w, m->b.height, m->lrpad / 2, client_get_title(c), 0); + } else { + drwl_text(m->drw, x, 0, w, m->b.height, (w - TEXTW(selmon, client_get_title(c))) / 2, client_get_title(c), 0); diff --git a/patches/centertitle/centertitle.webp b/patches/bartruecenteredtitle/centeredtitle.webp similarity index 100% rename from patches/centertitle/centertitle.webp rename to patches/bartruecenteredtitle/centeredtitle.webp