dvtm

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

commit 1d0ba339f00ff71ad98d95539b762200a2edecea
parent be7a7bb33e0ba1124abdfbf1e128bdac675ad003
Author: Marc Andre Tanner <mat@brain-dump.org>
Date:   Wed, 13 Mar 2013 19:54:03 +0100

Add -t command line switch to set a static window title

Signed-off-by: Marc Andre Tanner <mat@brain-dump.org>

Diffstat:
dvtm.1 | 7+++++++
dvtm.c | 17+++++++++++------
2 files changed, 18 insertions(+), 6 deletions(-)

diff --git a/dvtm.1 b/dvtm.1 @@ -12,6 +12,8 @@ dvtm \- dynamic virtual terminal manager .IR delay ] .RB [ \-h .IR lines ] +.RB [ \-t +.IR title ] .RB [ \-s .IR status-fifo ] .RB [ \-c @@ -40,6 +42,11 @@ part of an escape sequence is actually part of an escape sequence. .BI \-h \ lines Set the scrollback history buffer size at runtime. .TP +.BI \-t \ title +Set a static terminal +.I title +and don't change it to the one of the currently focused window. +.TP .BI \-s \ status-fifo Open or create the named pipe .I status-fifo diff --git a/dvtm.c b/dvtm.c @@ -178,6 +178,7 @@ static void resize(Client *c, int x, int y, int w, int h); extern Screen screen; static unsigned int waw, wah, wax, way; static Client *clients = NULL; +static char *title; #define COLOR(fg, bg) COLOR_PAIR(vt_color_reserve(fg, bg)) #include "config.h" @@ -380,8 +381,11 @@ detach(Client *c) { static void settitle(Client *c) { - if (sel == c && *c->title) - printf("\033]0;%s\007", c->title); + char *t = title; + if (!t && sel == c && *c->title) + t = c->title; + if (t) + printf("\033]0;%s\007", t); } static void @@ -1248,10 +1252,8 @@ open_or_create_fifo(const char *name, const char **name_created) { static void usage() { cleanup(); - eprint("usage: dvtm [-v] [-M] [-m mod] [-d delay] [-h lines] " - "[-s status-fifo] " - "[-c cmd-fifo] " - "[cmd...]\n"); + eprint("usage: dvtm [-v] [-M] [-m mod] [-d delay] [-h lines] [-t title] " + "[-s status-fifo] [-c cmd-fifo] [cmd...]\n"); exit(EXIT_FAILURE); } @@ -1299,6 +1301,9 @@ parse_args(int argc, char *argv[]) { case 'h': screen.history = atoi(argv[++arg]); break; + case 't': + title = argv[++arg]; + break; case 's': bar.fd = open_or_create_fifo(argv[++arg], &bar.file); updatebarpos();