├── bash-prompt.png ├── README.md ├── .gitignore ├── profile └── prompt_resources /bash-prompt.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/simple/dotfiles/master/bash-prompt.png -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # My dotfiles 2 | 3 | ## profile 4 | * update DOTFILES_DIR and link $HOME/.profile -> $DOTFILES_DIR/profile 5 | 6 | ## prompt_resources 7 | * colors and emoji definitions for PS1 8 | * PS1 with emojis 9 | ![alt tag](https://raw.github.com/simple/dotfiles/master/bash-prompt.png) 10 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | bashrc_dispatch 3 | secrets 4 | bash_backup 5 | bin/.ropeproject* 6 | bin/msgcat 7 | bin/msgcmp 8 | bin/msgcomm 9 | bin/msgconv 10 | bin/msgen 11 | bin/msgexec 12 | bin/msgfilter 13 | bin/msgfmt 14 | bin/msggrep 15 | bin/msginit 16 | bin/msgmerge 17 | bin/msgunfmt 18 | bin/msguniq 19 | bin/sonar-runner 20 | bin/sonar.sh 21 | bin/subl 22 | bin/wrapper 23 | bin/xgettext 24 | -------------------------------------------------------------------------------- /profile: -------------------------------------------------------------------------------- 1 | export BASH_SILENCE_DEPRECATION_WARNING=1 2 | 3 | export CLICOLOR=1 4 | export LSCOLORS="ExGxFxdxCxDxDxhbadExEx" 5 | export HISTCONTROL=erasedups 6 | export HISTSIZE=10000 7 | shopt -s histappend 8 | 9 | alias ls='ls -FGH' 10 | alias gb='git branch' 11 | alias gba='git branch -a' 12 | alias gd='git diff' 13 | alias gs='git status' 14 | alias git-aliases='alias| grep gi[t]' 15 | 16 | DOTFILES_DIR=$HOME/playground/dotfiles 17 | source $DOTFILES_DIR/prompt_resources 18 | function ps1_from_exit_status { 19 | if [ $1 -eq 0 ]; then face=$(emoji yheart); else face=$(emoji scream); fi 20 | printf "\n$EBLACK[$(date +'%H:%M:%S')]$ERED@$(hostname -s):$NO_COLOR" 21 | printf "$(pwd | sed -e 's@/Users/wongi.ju@~@') " 22 | printf "$EGREEN$(vcprompt -f "[%b%u%m@%r]")$NO_COLOR\n" 23 | printf "$face " 24 | } 25 | PS1="\$(ps1_from_exit_status \$?) " 26 | PS2="$ARROW18 " 27 | 28 | eval "$(/opt/homebrew/bin/brew shellenv)" 29 | 30 | export PATH=$PATH:$HOME/bin 31 | -------------------------------------------------------------------------------- /prompt_resources: -------------------------------------------------------------------------------- 1 | # http://wiki.archlinux.org/index.php/Color_Bash_Prompt#List_of_colors_for_prompt_and_bash 2 | # misc 3 | NO_COLOR='\e[0m' #disable any colors 4 | # regular colors 5 | BLACK='\e[0;30m' 6 | RED='\e[0;31m' 7 | GREEN='\e[0;32m' 8 | YELLOW='\e[0;33m' 9 | BLUE='\e[0;34m' 10 | MAGENTA='\e[0;35m' 11 | CYAN='\e[0;36m' 12 | WHITE='\e[0;37m' 13 | # emphasized (bolded) colors 14 | EBLACK='\e[1;30m' 15 | ERED='\e[1;31m' 16 | EGREEN='\e[1;32m' 17 | EYELLOW='\e[1;33m' 18 | EBLUE='\e[1;34m' 19 | EMAGENTA='\e[1;35m' 20 | ECYAN='\e[1;36m' 21 | EWHITE='\e[1;37m' 22 | # underlined colors 23 | UBLACK='\e[4;30m' 24 | URED='\e[4;31m' 25 | UGREEN='\e[4;32m' 26 | UYELLOW='\e[4;33m' 27 | UBLUE='\e[4;34m' 28 | UMAGENTA='\e[4;35m' 29 | UCYAN='\e[4;36m' 30 | UWHITE='\e[4;37m' 31 | # background colors 32 | BBLACK='\e[40m' 33 | BRED='\e[41m' 34 | BGREEN='\e[42m' 35 | BYELLOW='\e[43m' 36 | BBLUE='\e[44m' 37 | BMAGENTA='\e[45m' 38 | BCYAN='\e[46m' 39 | BWHITE='\e[47m' 40 | 41 | # Arrows: → ↛ ⇾ ↝ ↠ ↣ ↦ ↬ ⇒ ⇛ ⇢ ⇥ ⇨ ⇰ ⇸ ⇾ ↳ ↪ 42 | ARROW1="→" 43 | ARROW2="↛" 44 | ARROW3="⇾" 45 | ARROW4="↝" 46 | ARROW5="↠" 47 | ARROW6="↣" 48 | ARROW7="↦" 49 | ARROW8="↬" 50 | ARROW9="⇒" 51 | ARROW10="⇛" 52 | ARROW11="⇢" 53 | ARROW12="⇥" 54 | ARROW13="⇨" 55 | ARROW14="⇰" 56 | ARROW15="⇸" 57 | ARROW16="⇾" 58 | ARROW17="↳" 59 | ARROW18="↪" 60 | 61 | # emoji 62 | # check http://en.wikipedia.org/wiki/Emoji 63 | echo "1" > /tmp/20140416_one_time_true 64 | function is_first_call() 65 | { 66 | read v < /tmp/20140416_one_time_true 67 | echo "0" > /tmp/20140416_one_time_true 68 | echo $v 69 | } 70 | 71 | function emoji { 72 | [[ -z $1 ]] && echo -n "" && return 73 | [[ $(is_first_call) == 1 ]] && echo -n "${EYELLOW}2014/04/16$NO_COLOR " 74 | [[ $1 == "yheart" ]] && echo -n 🎗 # 💛 75 | [[ $1 == "scream" ]] && echo -n 😱 76 | [[ $1 == "rocket" ]] && echo -n 🚀 77 | [[ $1 == "snake" ]] && echo -n 🐍 78 | [[ $1 == "fire" ]] && echo -n 🔥 79 | [[ $1 == "santa" ]] && echo -n 🎅🏻 80 | [[ $1 == "santa2" ]] && echo -n 🎅 81 | [[ $1 == "hearted" ]] && echo -n 😍 82 | } 83 | --------------------------------------------------------------------------------