libmsgmng.lib: allow users to write and select customized color schemes (~/.autospec.d/color-theme.<color_scheme>)

Signed-off-by: Davide Madrisan <davide.madrisan@gmail.com>
This commit is contained in:
Davide Madrisan 2012-11-11 19:33:38 +01:00
parent a2056ba9d5
commit c8faaf8a70
2 changed files with 11 additions and 3 deletions

View File

@ -1,4 +1,5 @@
Changes in version 1.14.2
--- Nov -- 2012 Davide Madrisan <davide.madrisan(a)gmail.com>
+ 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 <color-theme>'.
+ improvement
* libmsgmng.lib - Davide Madrisan:
Allow users to write and select customized color schemes:
~/.autospec.d/color-theme.<color_scheme>"
-------------------------------------------------------------------------------
Changes in version 1.14.1 - _TO*Hacklab release

View File

@ -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