remove window titles from bar

This commit is contained in:
pi66 2025-12-09 20:54:02 +01:00
parent e240c8bf84
commit 9d6dbb2709
2 changed files with 51 additions and 0 deletions

View File

@ -0,0 +1,13 @@
# Description
toggle window title display in bar
> NOTE:
The patch works on (main 2025-12-09) and v0.7
# Download
- [git branch](https://codeberg.org/pi66/dwl-patches/raw/branch/main/patches/bar-notitle/bar-notitle.patch)
- [main 2025-11-01](https://codeberg.org/dwl/dwl-patches/raw/branch/main/patches/bar-notitle/bar-notitle.patch)
- [v0.7](https://codeberg.org/dwl/dwl-patches/raw/branch/main/patches/bar-notitle/bar-notitle.patch)
# Authors
- [pi66](https://pi66.xyz)

View File

@ -0,0 +1,38 @@
From 3bb3fd29c72e77347356dc0fb5ad50787fcb14bf Mon Sep 17 00:00:00 2001
From: pi66 <pixel2176@proton.me>
Date: Tue, 9 Dec 2025 20:39:55 +0100
Subject: [PATCH] remove window titles from bar
---
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 1b7472d..790c048 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 client_title = 0; /* 1 means show focused client name */
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 bf340d8..3294820 100644
--- a/dwl.c
+++ b/dwl.c
@@ -1612,7 +1612,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 && client_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.51.2