module "color": support more locations for DIR_COLORS

This commit is contained in:
Alexander Gehrke 2016-01-05 04:08:20 +01:00
parent 080374756a
commit 2457300ac6

View file

@ -36,12 +36,16 @@ if [[ "`tput colors`" == "256" ]] || [[ "`tput colors`" == "88" ]] ; then
hostcolor=$gitclean hostcolor=$gitclean
fi fi
usercolor="%{${FX[bold]}${FG[$usercolor_base]}%}" usercolor="%{${FX[bold]}${FG[$usercolor_base]}%}"
# 8-color-term
if [ -e /etc/DIR_COLORS.256 ] ; then for colorfile in /etc/DIR_COLORS.256 \
eval "$(dircolors /etc/DIR_COLORS.256)" /etc/DIR_COLORS.256color \
elif [ -e /etc/DIR_COLORS ]; then /etc/colors/DIR_COLORS.256 \
eval "$(dircolors /etc/DIR_COLORS)" /etc/colors/DIR_COLORS.256color; do
if [ -e $colorfile ] ; then
eval "$(dircolors $colorfile)"
break;
fi fi
done
else else
pathcolor="%{$fg_bold[blue]}%}" pathcolor="%{$fg_bold[blue]}%}"
@ -70,6 +74,6 @@ else
hostcolor="%{${fg_bold[black]}%}" hostcolor="%{${fg_bold[black]}%}"
fi fi
fi fi
[ -e /etc/DIR_COLORS ] && eval "$(dircolors /etc/DIR_COLORS)"
fi fi
[[ -z "$LS_COLORS" ]] && [ -e /etc/DIR_COLORS ] && eval "$(dircolors /etc/DIR_COLORS)"