From b1515657d4754327e62760f55ec7c6fc873f6fe9 Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Mon, 15 May 2017 15:33:32 -0400 Subject: bash: don't warn if ~/.config/dir_colors doesn't exist --- .config/bash/rc.d/10_aliases.sh | 12 +++++++++--- 1 file 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' -- cgit v1.1-4-g5e80 From 898449d60e0f9966db1fe223998f7ad1e5eb45ad Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Mon, 15 May 2017 15:33:51 -0400 Subject: login: load config-path better --- .config/login.d/00_path.sh | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/.config/login.d/00_path.sh b/.config/login.d/00_path.sh index ae2e8db..dda528a 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[@]}" -)" -- cgit v1.1-4-g5e80 From 6023f67b634c0a3f4dca214b45dd76c6d2116059 Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Mon, 15 May 2017 15:40:23 -0400 Subject: aliases: check for colordiff existance for the 'diff' alias --- .config/bash/rc.d/10_aliases.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.config/bash/rc.d/10_aliases.sh b/.config/bash/rc.d/10_aliases.sh index 9505271..9d008e2 100644 --- a/.config/bash/rc.d/10_aliases.sh +++ b/.config/bash/rc.d/10_aliases.sh @@ -69,7 +69,7 @@ if type dircolors &>/dev/null; then } diff() { - if [[ -t 1 ]]; then + if [[ -t 1 ]] && type colordiff &>/dev/null; then ( set -o pipefail command diff "$@" | colordiff -- cgit v1.1-4-g5e80 From 2644226e08f429467f79007be853ebc7b66c395b Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Mon, 15 May 2017 15:44:05 -0400 Subject: oops --- .config/login.d/00_path.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.config/login.d/00_path.sh b/.config/login.d/00_path.sh index dda528a..8b3484f 100644 --- a/.config/login.d/00_path.sh +++ b/.config/login.d/00_path.sh @@ -1,7 +1,7 @@ #!/hint/sh if type config-path &>/dev/null; then eval "$(config-path | sed 's/^/export //')" -elif [[ -x "$HOME/.local/bin/config-path"; then +elif [[ -x "$HOME/.local/bin/config-path" ]]; then # Bootstrap finding config-path eval "$("$HOME/.local/bin/config-path" | sed 's/^/export //')" fi -- cgit v1.1-4-g5e80 From 9fe48ff5cc04adf81496cc6f39e9c0c2a8668b79 Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Mon, 15 May 2017 15:44:50 -0400 Subject: oops --- .config/login.d/00_path.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.config/login.d/00_path.sh b/.config/login.d/00_path.sh index 8b3484f..aa62f75 100644 --- a/.config/login.d/00_path.sh +++ b/.config/login.d/00_path.sh @@ -1,7 +1,7 @@ #!/hint/sh if type config-path &>/dev/null; then - eval "$(config-path | sed 's/^/export //')" + eval "$(config-path | sed 's/^/export /')" elif [[ -x "$HOME/.local/bin/config-path" ]]; then # Bootstrap finding config-path - eval "$("$HOME/.local/bin/config-path" | sed 's/^/export //')" + eval "$("$HOME/.local/bin/config-path" | sed 's/^/export /')" fi -- cgit v1.1-4-g5e80