From ed6c6b36c0379f97d76f11c31c74bdfc70053780 Mon Sep 17 00:00:00 2001 From: James Booth Date: Thu, 29 Nov 2012 20:11:46 +0000 Subject: [PATCH] Added terminal window title --- src/windows.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/src/windows.c b/src/windows.c index 6efc9e19..269339c6 100644 --- a/src/windows.c +++ b/src/windows.c @@ -123,6 +123,21 @@ ui_init(void) void ui_refresh(void) { + jabber_conn_status_t status = jabber_get_connection_status(); + + if (status == JABBER_CONNECTED) { + const char * const jid = jabber_get_jid(); + gint unread = _win_get_unread(); + + if (unread != 0) { + printf("%c]0;*%s - %s (%d unread)%c", '\033', "Profanity", jid, unread, '\007'); + } else { + printf("%c]0;%s - %s%c", '\033', "Profanity", jid, '\007'); + } + } else { + printf("%c]0;%s%c", '\033', "Profanity", '\007'); + } + title_bar_refresh(); status_bar_refresh();