diff options
Diffstat (limited to '.config/bash')
-rw-r--r-- | .config/bash/rc.d/10_aliases.sh | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/.config/bash/rc.d/10_aliases.sh b/.config/bash/rc.d/10_aliases.sh index c3766da..9d008e2 100644 --- a/.config/bash/rc.d/10_aliases.sh +++ b/.config/bash/rc.d/10_aliases.sh @@ -3,9 +3,15 @@ ###################################################################### # Set up colors and settings for all the things # ###################################################################### -if [ -x "`which dircolors`" ]; then - eval "$(dircolors -p | cat - "${XDG_CONFIG_HOME}/dir_colors" | - dircolors -b -)" +if type dircolors &>/dev/null; then + eval "$( + { + dircolors -p + if [[ -f "${XDG_CONFIG_HOME}/dir_colors" ]]; then + cat "${XDG_CONFIG_HOME}/dir_colors" + fi + } | dircolors -b - + )" alias ls='ls -1v --color=auto' alias dir='dir -v --color=auto' alias vdir='vdir -v --color=auto' @@ -63,7 +69,7 @@ if [ -x "`which dircolors`" ]; then } diff() { - if [[ -t 1 ]]; then + if [[ -t 1 ]] && type colordiff &>/dev/null; then ( set -o pipefail command diff "$@" | colordiff |