dvtm

dynamic virtual terminal manager - with my changes
git clone https://pi.duncano.de/git/dvtm.git
Log | Files | Refs | README | LICENSE

commit 765cdf83282343695ea23eefb7bbfc9b9dad06a4
parent b308dd00d2839bba49430f3f21875bb6c72f46d4
Author: Marc André Tanner <mat@brain-dump.org>
Date:   Mon, 16 Feb 2015 10:51:43 +0100

Hardcode title bar format specifiers

Diffstat:
config.def.h | 6------
dvtm.c | 7+++----
2 files changed, 3 insertions(+), 10 deletions(-)

diff --git a/config.def.h b/config.def.h @@ -34,12 +34,6 @@ static Color colors[] = { #define BAR_POS BAR_TOP /* BAR_BOTTOM, BAR_OFF */ /* whether status bar should be hidden if only one client exists */ #define BAR_AUTOHIDE true -/* separator between window title and window number */ -#define SEPARATOR " | " -/* printf format string for the window title, first %s - * is replaced by the title, second %s is replaced by - * the SEPARATOR, %d stands for the window number */ -#define TITLE "[%s%s#%d]" /* master width factor [0.1 .. 0.9] */ #define MFACT 0.5 /* number of clients in master area */ diff --git a/dvtm.c b/dvtm.c @@ -164,7 +164,6 @@ typedef struct { } Editor; #define LENGTH(arr) (sizeof(arr) / sizeof((arr)[0])) -#define STRLEN(str) (sizeof(str) - 1) #define MAX(x, y) ((x) > (y) ? (x) : (y)) #define MIN(x, y) ((x) < (y) ? (x) : (y)) #define TAGMASK ((1 << LENGTH(tags)) - 1) @@ -397,7 +396,7 @@ draw_border(Client *c) { wattrset(c->window, attrs); getyx(c->window, y, x); mvwhline(c->window, 0, 0, ACS_HLINE, c->w); - maxlen = c->w - (2 + STRLEN(TITLE) - STRLEN("%s%sd") + STRLEN(SEPARATOR) + 2); + maxlen = c->w - 10; if (maxlen < 0) maxlen = 0; if ((size_t)maxlen < sizeof(c->title)) { @@ -405,9 +404,9 @@ draw_border(Client *c) { c->title[maxlen] = '\0'; } - mvwprintw(c->window, 0, 2, TITLE, + mvwprintw(c->window, 0, 2, "[%s%s#%d]", *c->title ? c->title : "", - *c->title ? SEPARATOR : "", + *c->title ? " | " : "", c->order); if (t) c->title[maxlen] = t;