dvtm

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

commit c33d1321bbd8bdf2012193da5d1fe2dc439f32f5
parent a24b5d440429c8442682687a359c9a561f7bc51c
Author: Marc André Tanner <mat@brain-dump.org>
Date:   Thu, 12 Feb 2015 11:02:47 +0100

Always display status bar text right aligned

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

diff --git a/config.def.h b/config.def.h @@ -34,8 +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 -/* determines whether the statusbar text should be right or left aligned */ -#define BAR_ALIGN ALIGN_RIGHT /* separator between window title and window number */ #define SEPARATOR " | " /* printf format string for the window title, first %s diff --git a/dvtm.c b/dvtm.c @@ -134,7 +134,6 @@ typedef struct { } Cmd; enum { BAR_TOP, BAR_BOTTOM, BAR_OFF }; -enum { ALIGN_LEFT, ALIGN_RIGHT }; typedef struct { int fd; @@ -357,13 +356,9 @@ drawbar(void) { size_t numchars = mbstowcs(wbuf, bar.text, sizeof bar.text); if (numchars != (size_t)-1 && (width = wcswidth(wbuf, maxwidth)) != -1) { - int pos = 0; - if (BAR_ALIGN == ALIGN_RIGHT) { - while (pos + width < maxwidth) { - addch(' '); - pos++; - } - } + int pos; + for (pos = 0; pos + width < maxwidth; pos++) + addch(' '); for (size_t i = 0; i < numchars; i++) { pos += wcwidth(wbuf[i]);