dvtm

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

commit 85c78bf168b3bd1d1f1daa20448e31cae4b2ff14
parent ee63fd7d2874d1b97693e0176fb94ddeed153ed8
Author: Marc Andre Tanner <mat@brain-dump.org>
Date:   Mon, 11 Feb 2013 09:57:47 +0100

Set dvtm's window title to the one of currently focused window

This has the effect that the dwm statusbar shows the title
of the currently focused window instead of the one of the shell
which started dvtm.

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

Diffstat:
dvtm.c | 8++++++++
1 file changed, 8 insertions(+), 0 deletions(-)

diff --git a/dvtm.c b/dvtm.c @@ -378,11 +378,18 @@ detach(Client *c) { } static void +settitle(Client *c) { + if (sel == c && *c->title) + printf("\033]0;%s\007", c->title); +} + +static void focus(Client *c) { Client *tmp = sel; if (sel == c) return; sel = c; + settitle(c); if (tmp) { draw_border(tmp); wrefresh(tmp->window); @@ -420,6 +427,7 @@ term_event_handler(Vt *term, int event, void *event_data) { if (event_data) strncpy(c->title, event_data, sizeof(c->title) - 1); c->title[event_data ? sizeof(c->title) - 1 : 0] = '\0'; + settitle(c); draw_border(c); applycolorrules(c); break;