Cleanup and restructure
This commit is contained in:
parent
c353a0b9bb
commit
15af55e802
@ -2,4 +2,4 @@
|
||||
# ~/.bash_profile
|
||||
#
|
||||
|
||||
[[ -f ~/.bashrc ]] && . ~/.bashrc
|
||||
[[ -r ~/.bashrc ]] && . ~/.bashrc
|
||||
|
29
.bashrc
29
.bashrc
@ -4,7 +4,6 @@
|
||||
|
||||
[[ $- != *i* ]] && return
|
||||
|
||||
[ -r /usr/share/bash-completion/bash_completion ] && . /usr/share/bash-completion/bash_completion
|
||||
# Bash won't get SIGWINCH if another process is in the foreground.
|
||||
# Enable checkwinsize so that bash will check the terminal size when
|
||||
# it regains control. #65623
|
||||
@ -12,8 +11,6 @@
|
||||
shopt -s checkwinsize
|
||||
shopt -s expand_aliases
|
||||
|
||||
# export QT_SELECT=4
|
||||
|
||||
# Enable history appending instead of overwriting. #139609
|
||||
shopt -s histappend
|
||||
HISTCONTROL=ignoreboth
|
||||
@ -32,6 +29,15 @@ esac
|
||||
|
||||
use_color=true
|
||||
|
||||
# Enable colors for ls, etc. Prefer ~/.dir_colors #64489
|
||||
if type -P dircolors >/dev/null ; then
|
||||
if [[ -f ~/.dir_colors ]] ; then
|
||||
eval $(dircolors -b ~/.dir_colors)
|
||||
elif [[ -f /etc/DIR_COLORS ]] ; then
|
||||
eval $(dircolors -b /etc/DIR_COLORS)
|
||||
fi
|
||||
fi
|
||||
|
||||
# Set colorful PS1 only on colorful terminals.
|
||||
# dircolors --print-database uses its own built-in database
|
||||
# instead of using /etc/DIR_COLORS. Try to use the external file
|
||||
@ -96,14 +102,6 @@ if ${use_color} ; then
|
||||
Reset='\[\033[0m\]'
|
||||
Bold='\[\033[1m\]'
|
||||
Invert='\[\033[7m\]'
|
||||
# Enable colors for ls, etc. Prefer ~/.dir_colors #64489
|
||||
if type -P dircolors >/dev/null ; then
|
||||
if [[ -f ~/.dir_colors ]] ; then
|
||||
eval $(dircolors -b ~/.dir_colors)
|
||||
elif [[ -f /etc/DIR_COLORS ]] ; then
|
||||
eval $(dircolors -b /etc/DIR_COLORS)
|
||||
fi
|
||||
fi
|
||||
TimeColour=$LghtYlw
|
||||
HostColour="\[$(get_hostname_colour)\]"
|
||||
if [[ ${EUID} == 0 ]]; then
|
||||
@ -114,19 +112,16 @@ if ${use_color} ; then
|
||||
CDirColour=$DarkGrn
|
||||
PS1="$TimeColour[\t] $Bold$UserColour\u${HostColour}@\h $Reset$CDirColour\$PWD$Reset $Bold\n$UserColour\\$ ${Reset}"
|
||||
else
|
||||
if [[ ${EUID} == 0 ]] ; then
|
||||
# show root@ when we don't have colors
|
||||
PS1='\u@\h \W \$ '
|
||||
else
|
||||
PS1='\u@\h \w \$ '
|
||||
fi
|
||||
fi
|
||||
|
||||
unset use_color safe_term match_lhs sh
|
||||
|
||||
xhost +local:root > /dev/null 2>&1
|
||||
|
||||
# export QT_SELECT=4
|
||||
export PATH=$PATH:~/.local/bin:~/bin
|
||||
export EDITOR=vim
|
||||
|
||||
[[ -f ~/.bash_aliases ]] && . ~/.bash_aliases
|
||||
[[ -r ~/.bash_aliases ]] && . ~/.bash_aliases
|
||||
[[ -r /usr/share/bash-completion/bash_completion ]] && . /usr/share/bash-completion/bash_completion
|
||||
|
Loading…
x
Reference in New Issue
Block a user