.profile: Add dircolors support, make safe for POSIX sh
Though it's still not quite where I want it
This commit is contained in:
14
.profile
14
.profile
@@ -63,6 +63,16 @@ done
|
||||
# Then finally set up our path
|
||||
PATH="$desiredpath:$PATH"
|
||||
|
||||
# Grab dircolors, if it exists
|
||||
if command -v dircolors > /dev/null 2>&1; then
|
||||
dircolorsfile="$HOME/.config/dircolors"
|
||||
if [ -r "$dircolorsfile" ]; then
|
||||
eval "$(dircolors "$dircolorsfile")"
|
||||
else
|
||||
eval "$(dircolors -b)"
|
||||
fi
|
||||
fi
|
||||
|
||||
# Grab bash_completion, if it exists
|
||||
[ -f "/etc/profile.d/bash_completion.sh" ] && . "/etc/profile.d/bash_completion.sh"
|
||||
|
||||
@@ -148,7 +158,7 @@ alias todo='$EDITOR "$HOME/Documents/todo"'
|
||||
alias waitwhat='echo $?'
|
||||
|
||||
# Source ~/.functions, if it exists
|
||||
[ -r "$HOME/.functions" ] && . "$HOME/.functions"
|
||||
[ -r "$HOME/.functions" ] && [ "$_baseshell" != "sh" ] && . "$HOME/.functions"
|
||||
|
||||
# Set up a default PS1
|
||||
# This *should* work for all terminals. I know it works on ksh
|
||||
@@ -205,7 +215,7 @@ case "$_baseshell" in
|
||||
# I have a custom theme for that
|
||||
;;
|
||||
sh)
|
||||
export PS1=''
|
||||
export PS1='\$ '
|
||||
;;
|
||||
*)
|
||||
export PS1='$(_ps1)'
|
||||
|
Reference in New Issue
Block a user