summaryrefslogtreecommitdiff
path: root/.config/bash/rc.d/10_aliases.sh
diff options
context:
space:
mode:
authorLuke Shumaker <lukeshu@lukeshu.com>2018-01-10 19:38:58 -0500
committerLuke Shumaker <lukeshu@lukeshu.com>2018-01-10 19:38:58 -0500
commita2cd9d788f7b39e9f17d1fa2dc1382bd2f98e2c1 (patch)
treef2f5c900f0c9aded26d3d9ca0c25e9a6029a7a9e /.config/bash/rc.d/10_aliases.sh
parent75a63c7e7b3b055198884f31c0d7c516eaf9d32e (diff)
parent971e265cac74976670da2a87805b644e90826b95 (diff)
Merge branch 'master' into build64-par/master
Diffstat (limited to '.config/bash/rc.d/10_aliases.sh')
-rw-r--r--.config/bash/rc.d/10_aliases.sh14
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