diff options
author | midipix <writeonce@midipix.org> | 2019-01-18 16:28:55 -0500 |
---|---|---|
committer | midipix <writeonce@midipix.org> | 2019-01-18 16:36:56 -0500 |
commit | 5d8ce8e3edbeb8c356bf4f17d06052a6973eebb8 (patch) | |
tree | 1ad2630292ecf74e1077cddfa6b492aae848f4ab /common | |
parent | 5b2231cf4f7b46b2cd883d15d34acec4db18cf56 (diff) | |
download | mpackage-5d8ce8e3edbeb8c356bf4f17d06052a6973eebb8.tar.bz2 mpackage-5d8ce8e3edbeb8c356bf4f17d06052a6973eebb8.tar.xz |
.bashrc: prepend $HOME/.local/bin to PATH as needed, provide common aliases.
Diffstat (limited to 'common')
-rw-r--r-- | common/home/midipix/.bashrc | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/common/home/midipix/.bashrc b/common/home/midipix/.bashrc index 54406e9..19d9028 100644 --- a/common/home/midipix/.bashrc +++ b/common/home/midipix/.bashrc @@ -1,2 +1,38 @@ # proceed only in interactive mode [[ "$-" != *i* ]] && return + +# home +export HOME=/home/$(whoami) + +# PS1 +if [ "$TERM" = xterm ]; then + export PS1='\[\e]0;\w\a\]\n\[\e[32m\]\u@\h \[\e[33m\]\w\[\e[0m\]\n\$ ' +else + export PS1='\n\w \$ ' +fi + +# aliases +if [ -x /bin/dircolors ]; then + alias ls='ls --color=auto' + alias grep='grep --color=auto' + alias fgrep='fgrep --color=auto' + alias egrep='egrep --color=auto' +fi + +alias ll='ls -alF' +alias la='ls -A' +alias l='ls -CF' + +# prepend $HOME/.local/bin: to PATH as needed +IFS_SAVED=${IFS}; IFS=':'; +ADD=$HOME/.local/bin: + +for path_element in $PATH; do + if [ "$ADD" = "$path_element:" ]; then + ADD= + fi +done + +export PATH="$ADD$PATH" + +IFS=${IFS_SAVED} |