From c8faaf8a700ee5c8100b02be66b32c74f409ccd5 Mon Sep 17 00:00:00 2001 From: Davide Madrisan Date: Sun, 11 Nov 2012 19:33:38 +0100 Subject: [PATCH] libmsgmng.lib: allow users to write and select customized color schemes (~/.autospec.d/color-theme.) Signed-off-by: Davide Madrisan --- ChangeLog | 6 ++++++ lib/libmsgmng.lib.in | 8 +++++--- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index 410c668..1895e41 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,4 +1,5 @@ Changes in version 1.14.2 +--- Nov -- 2012 Davide Madrisan + bugfix * plugins/* - Davide Madrisan: @@ -45,6 +46,11 @@ Changes in version 1.14.2 * autospec, autospec.conf, plugins/* - Davide Madrisan: Replace the option '--colorize' by '--colors '. ++ improvement + * libmsgmng.lib - Davide Madrisan: + Allow users to write and select customized color schemes: + ~/.autospec.d/color-theme." + ------------------------------------------------------------------------------- Changes in version 1.14.1 - _TO*Hacklab release diff --git a/lib/libmsgmng.lib.in b/lib/libmsgmng.lib.in index bae2b0f..7c823e0 100644 --- a/lib/libmsgmng.lib.in +++ b/lib/libmsgmng.lib.in @@ -50,9 +50,11 @@ function notify.note() { # args: # none function notify.enable_colors() { - local color_scheme="$1" - [ "$color_scheme" ] || color_scheme="default" - if [ -r /etc/@package@.d/color-theme.${color_scheme} ]; then + local color_scheme="${1:-default}" + if [ -r ~/.@package@.d/color-theme.${color_scheme} ]; then + . ~/.@package@.d/color-theme.${color_scheme} + notify.debug "loading ~/.@package@.d/color-theme.${color_scheme}" + elif [ -r /etc/@package@.d/color-theme.${color_scheme} ]; then . /etc/@package@.d/color-theme.${color_scheme} notify.debug "loading /etc/@package@.d/color-theme.${color_scheme}" else