summaryrefslogtreecommitdiff
path: root/.config/bash
diff options
context:
space:
mode:
authorLuke Shumaker <lukeshu@lukeshu.com>2017-05-15 15:33:32 -0400
committerLuke Shumaker <lukeshu@lukeshu.com>2017-05-15 15:33:32 -0400
commitb1515657d4754327e62760f55ec7c6fc873f6fe9 (patch)
tree840ba72bf0fc56881b45a8a97e56cd4bd0fb8653 /.config/bash
parent05b500a6688c7a7ff9a04fe748a091d33df654a9 (diff)
bash: don't warn if ~/.config/dir_colors doesn't exist
Diffstat (limited to '.config/bash')
-rw-r--r--.config/bash/rc.d/10_aliases.sh12
1 files changed, 9 insertions, 3 deletions
diff --git a/.config/bash/rc.d/10_aliases.sh b/.config/bash/rc.d/10_aliases.sh
index c3766da..9505271 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'