diff options
author | Kalle Wallin <kaw@linux.se> | 2004-06-24 16:08:24 +0000 |
---|---|---|
committer | Kalle Wallin <kaw@linux.se> | 2004-06-24 16:08:24 +0000 |
commit | b0353fc77099ec9e95310ca4e106d88985ee05b4 (patch) | |
tree | 68c6c5fba41296eebccf2b3d92fd59156768ffb1 /src/screen_utils.c | |
parent | 31e6fa72cc45147feb11d62eba70c3d8f314301d (diff) | |
download | mpd-b0353fc77099ec9e95310ca4e106d88985ee05b4.tar.gz mpd-b0353fc77099ec9e95310ca4e106d88985ee05b4.tar.xz mpd-b0353fc77099ec9e95310ca4e106d88985ee05b4.zip |
Made the xterm title dynamic, added configuration option xterm-title-format
git-svn-id: https://svn.musicpd.org/ncmpc/trunk@1647 09075e82-0dd4-0310-85a5-a0d7c8717e4f
Diffstat (limited to '')
-rw-r--r-- | src/screen_utils.c | 21 |
1 files changed, 13 insertions, 8 deletions
diff --git a/src/screen_utils.c b/src/screen_utils.c index c5efc8e7d..c9abc7b1f 100644 --- a/src/screen_utils.c +++ b/src/screen_utils.c @@ -216,14 +216,19 @@ set_xterm_title(char *format, ...) /* the current xterm title exists under the WM_NAME property */ /* and can be retreived with xprop -id $WINDOWID */ - if( options.enable_xterm_title && g_getenv("WINDOWID") ) + if( options.enable_xterm_title ) { - char buffer[512]; - va_list ap; - - va_start(ap,format); - vsnprintf(buffer,sizeof(buffer),format,ap); - va_end(ap); - printf("%c]0;%s%c", '\033', buffer, '\007'); + if( g_getenv("WINDOWID") ) + { + char buffer[512]; + va_list ap; + + va_start(ap,format); + vsnprintf(buffer,sizeof(buffer),format,ap); + va_end(ap); + printf("%c]0;%s%c", '\033', buffer, '\007'); + } + else + options.enable_xterm_title = FALSE; } } |