summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLuke Shumaker <lukeshu@lukeshu.com>2017-11-08 14:32:24 -0500
committerLuke Shumaker <lukeshu@lukeshu.com>2017-11-08 14:32:24 -0500
commit3477cafcc1ecf1cefd2c36a7fac36c86443ea573 (patch)
tree89ca8607ec9a69f30b7fb8acef194e1eff7e78b1
parent32d1b9b2d9951e96e96e672b48d52498dbc7ab24 (diff)
parent9fe48ff5cc04adf81496cc6f39e9c0c2a8668b79 (diff)
Merge branch 'master' of git://lukeshu.com/dotfiles
-rw-r--r--.config/bash/rc.d/10_aliases.sh14
-rw-r--r--.config/login.d/00_path.sh11
2 files changed, 13 insertions, 12 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
diff --git a/.config/login.d/00_path.sh b/.config/login.d/00_path.sh
index ae2e8db..aa62f75 100644
--- a/.config/login.d/00_path.sh
+++ b/.config/login.d/00_path.sh
@@ -1,12 +1,7 @@
#!/hint/sh
-eval "$(
if type config-path &>/dev/null; then
- config_path=config-path
-else
+ eval "$(config-path | sed 's/^/export /')"
+elif [[ -x "$HOME/.local/bin/config-path" ]]; then
# Bootstrap finding config-path
- config_path="$HOME/.local/bin/config-path"
+ eval "$("$HOME/.local/bin/config-path" | sed 's/^/export /')"
fi
-IFS=$'\n'
-lines=($("$config_path"))
-printf -- 'export %s\n' "${lines[@]}"
-)"