From: Kalle Wallin Date: Mon, 3 May 2004 11:44:22 +0000 (+0000) Subject: The background color can now be assigned to 'none' (use the current color). X-Git-Tag: v0.12_alpha1~556 X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=b4983deb8e8efac613d4d1ec4c73235b35b5139b;p=ncmpc.git The background color can now be assigned to 'none' (use the current color). git-svn-id: https://svn.musicpd.org/ncmpc/trunk@898 09075e82-0dd4-0310-85a5-a0d7c8717e4f --- diff --git a/conf.c b/conf.c index 0c0448e..1205af5 100644 --- a/conf.c +++ b/conf.c @@ -97,8 +97,10 @@ str2color(char *str) return COLOR_CYAN; else if( !strcasecmp(str,"white") ) return COLOR_WHITE; + else if( !strcasecmp(str,"default") || !strcasecmp(str,"none") ) + return -1; fprintf(stderr,"Warning: unknown color %s\n", str); - return -1; + return -2; } static int @@ -330,7 +332,7 @@ read_rc_file(char *filename, options_t *options) /* background color */ else if( !strcasecmp(CONF_COLOR_BACKGROUND, name) ) { - if( (color=str2color(value)) >= 0 ) + if( (color=str2color(value)) >= -1 ) options->bg_color = color; } /* color - top (title) window */ diff --git a/doc/ncmpc.1 b/doc/ncmpc.1 index ca89ded..25b6951 100644 --- a/doc/ncmpc.1 +++ b/doc/ncmpc.1 @@ -1,4 +1,4 @@ -.TH "ncmpc" "1" "April 2004" "" "" +.TH "ncmpc" "1" "May 2004" "" "" .SH "NAME" ncmpc \- curses Music Player Daemon (MPD) client. .SH "SYNOPSIS" @@ -66,6 +66,9 @@ Make the cursor as wide as the screen. .B enable_colors = yes|no Enable/disable colors. .TP +.B background_color = color|none +Set the background color. If the background color is assigned to the keyword \fBnone\fR, ncmpc will not change the background color. +.TP .B title_color = color Set the text color for the title row (first row). .TP @@ -92,9 +95,7 @@ ncmpc is running. To edit key bindings use the key editor in ncmpc (press 'K'). Report bugs on http://www.musicpd.org/mantis/ .SH "NOTE" Since MPD uses UTF\-8, ncmpc needs to convert characters to the -charset used by the local system. If you get character conversion errors when your running ncmpc you probably need to set up your locale. This is done by setting any of the LC_CTYPE, LANG or LC_ALL enviroment variables (LC_CTYPE only affects character handling). For example if you want UK settings and use bash you should add the following line to your /etc/profile: - - export LC_CTYPE=en_UK +charset used by the local system. If you get character conversion errors when your running ncmpc you probably need to set up your locale. This is done by setting any of the LC_CTYPE, LANG or LC_ALL enviroment variables (LC_CTYPE only affects character handling). .SH "SE ALSO" mpc(1), mpd(1), locale(5), locale(7) diff --git a/screen.c b/screen.c index 8790966..67cbf6b 100644 --- a/screen.c +++ b/screen.c @@ -422,6 +422,7 @@ screen_init(void) if( has_colors() ) { start_color(); + use_default_colors(); if( options.enable_colors ) { init_pair(1, options.title_color, options.bg_color); @@ -431,8 +432,6 @@ screen_init(void) init_pair(5, options.status_color, options.bg_color); init_pair(6, options.alert_color, options.bg_color); } - else - use_default_colors(); } else if( options.enable_colors ) {