Last active
May 15, 2018 09:11
-
-
Save Leask/4153091 to your computer and use it in GitHub Desktop.
[DETACHED] Just another prompt with git infos and smile icons
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
RED="\[\033[31m\]" | |
GEN="\[\033[32m\]" | |
YEL="\[\033[33m\]" | |
OFF="\[\033[m\]" | |
NME="\u" | |
HST="\h" | |
DIR="\w" | |
DTE="`date`" | |
# TST="`date +%s`" | |
# LCT="[`whereami`]" | |
PMT="\`if [ $(id -u) = 0 ]; then echo ${YEL}# ❯$OFF; else echo ${YEL}$ ❯$OFF; fi\`" | |
# https://github.com/michaeldfallen/git-radar | |
# export GIT_RADAR_FETCH_TIME=30 | |
export GIT_RADAR_COLOR_BRANCH='\033[32m' # Green | |
if [ -f /usr/local/bin/git-radar ]; then | |
GIT="\$(git-radar --bash --fetch)" | |
fi | |
if [ `uname` = 'Darwin' ]; then | |
HPY='😃' | |
SAD='😓' | |
else | |
HPY=':)' | |
SAD=':(' | |
fi | |
MOD="\`if [ \$? = 0 ]; then echo ${HPY}; else echo ${SAD}; fi\`" | |
PS1="⎧ $DTE $MOD\n⎨ $NME@$RED$HST$OFF:$DIR$GIT\n⎩ $PMT " |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
@Leask https://github.com/cfddream/dotfiles/blob/master/.bash_prompt 优化了下