Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # Terminal settings
- # Enable colors on the command-line for things like ls.
- export CLICOLOR=1
- export LSCOLORS=dxfxcxexbxegedabagacad
- # Set the shell format to:
- # [host:user] [date] /path/to/pwd (size of files in dir)
- # $ <input>
- RED=$(tput setaf 1)
- GREEN=$(tput setaf 2)
- YELLOW=$(tput setaf 3)
- BLUE=$(tput setaf 4)
- NORM=$(tput sgr0)
- ENCLOSURE_COLOR=$YELLOW
- PATH_COLOR=$RED
- HOSTNAME_COLOR=$GREEN
- USER_COLOR=$GREEN
- TIMESTAMP_COLOR=$GREEN
- FILESIZE_COLOR=$GREEN
- COLON_COLOR=$YELLOW
- BRANCH_COLOR=$GREEN
- size_of_files_in_directory() {
- TBytes=`ls -l | awk 'BEGIN {sum=0} /^-/ {sum+=$5} END {print sum}'`
- TotalMeg=$(echo -e "scale=3 \n$TBytes/1048576 \nquit" | bc)
- echo -n "$TotalMeg"
- }
- parse_git_branch() {
- branch=`git branch 2> /dev/null | sed -e '/^[^*]/d' -e "s/* \(.*\)/\1/"`
- if [ -n "$branch" ]
- then
- echo -n " $ENCLOSURE_COLOR($BRANCH_COLOR$branch$ENCLOSURE_COLOR)$NORM"
- fi
- }
- PS1="\n$ENCLOSURE_COLOR[$HOSTNAME_COLOR\h$COLON_COLOR:$USER_COLOR\u$ENCLOSURE_COLOR] [$TIMESTAMP_COLOR\$(date +%m-%d\" \"%H:%M)$ENCLOSURE_COLOR] $PATH_COLOR\w $ENCLOSURE_COLOR($FILESIZE_COLOR\$(size_of_files_in_directory) Mb$ENCLOSURE_COLOR)$NORM\$(parse_git_branch)\n\$ "
Add Comment
Please, Sign In to add comment