mirror of
https://codeberg.org/dwl/dwl-patches.git
synced 2025-10-26 17:54:17 +00:00
Merge with branch "moonpatch"
This commit is contained in:
parent
c2d88beda8
commit
aff4ecbb82
9
patches/bartruecenteredtitle/README.md
Normal file
9
patches/bartruecenteredtitle/README.md
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
### Description
|
||||||
|
A homegrown port of dwm's _truecenteredtitle_ patch, with the addition of a config option to toggle its effects.<br>Requires [the bar patch](https://codeberg.org/dwl/dwl-patches/src/branch/main/patches/bar) to be applied beforehand.
|
||||||
|

|
||||||
|
|
||||||
|
### Download
|
||||||
|
- [v0.7](/dwl/dwl-patches/raw/branch/main/patches/bartruecenteredtitle/bar-truecenteredtitle-v0.7.patch)<br>Targets latest dwl release v0.7.
|
||||||
|
|
||||||
|
### Author
|
||||||
|
- [moonsabre](https://codeberg.org/moonsabre)
|
||||||
@ -0,0 +1,41 @@
|
|||||||
|
From be07463a7bc7a5b6f4860666d131e32b56e62ff0 Mon Sep 17 00:00:00 2001
|
||||||
|
From: moonsabre <moonsabre@tuta.io>
|
||||||
|
Date: Mon, 10 Mar 2025 22:26:38 -0700
|
||||||
|
Subject: [PATCH] Implement title centering parameter
|
||||||
|
|
||||||
|
---
|
||||||
|
config.def.h | 1 +
|
||||||
|
dwl.c | 6 +++++-
|
||||||
|
2 files changed, 6 insertions(+), 1 deletion(-)
|
||||||
|
|
||||||
|
diff --git a/config.def.h b/config.def.h
|
||||||
|
index 5d1dc2b..ecbf223 100644
|
||||||
|
--- a/config.def.h
|
||||||
|
+++ b/config.def.h
|
||||||
|
@@ -9,6 +9,7 @@ static const int bypass_surface_visibility = 0; /* 1 means idle inhibitors will
|
||||||
|
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 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 */
|
||||||
|
diff --git a/dwl.c b/dwl.c
|
||||||
|
index ece537a..d7ffce2 100644
|
||||||
|
--- a/dwl.c
|
||||||
|
+++ b/dwl.c
|
||||||
|
@@ -1551,7 +1551,11 @@ drawbar(Monitor *m)
|
||||||
|
if ((w = m->b.width - tw - x) > m->b.height) {
|
||||||
|
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 ((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);
|
||||||
|
+ }
|
||||||
|
if (c && c->isfloating)
|
||||||
|
drwl_rect(m->drw, x + boxs, boxs, boxw, boxw, 0, 0);
|
||||||
|
} else {
|
||||||
|
--
|
||||||
|
2.46.0
|
||||||
BIN
patches/bartruecenteredtitle/centeredtitle.webp
Normal file
BIN
patches/bartruecenteredtitle/centeredtitle.webp
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 25 KiB |
Loading…
x
Reference in New Issue
Block a user