New prompt segment `os_icon`.

pull/22/head
Dominik Ritter 9 years ago
parent f7cb946898
commit 0993e7ce88

@ -43,6 +43,16 @@
# POWERLEVEL9K_COLOR_SCHEME='light'
################################################################
# OS detection, default to Linux
case $(uname) in
FreeBSD) OS=FreeBSD ;;
DragonFly) OS=FreeBSD ;;
OpenBSD) OS=OpenBSD ;;
Darwin) OS=Darwin ;;
SunOS) OS=SunOS ;;
*) OS=Linux ;;
esac
# The `CURRENT_BG` variable is used to remember what the last BG color used was
# when building the left-hand prompt. Because the RPROMPT is created from
# right-left but reads the opposite, this isn't necessary for the other side.
@ -347,6 +357,19 @@ prompt_longstatus() {
[[ -n "$symbols" ]] && $1_prompt_segment $0 $bg $DEFAULT_COLOR "$symbols"
}
# print a little OS icon
prompt_os_icon() {
if [[ "$OS" == "Darwin" ]]; then
LOGO="\uF8FF" # 
elif [[ "$OS" == 'Linux' ]]; then
LOGO="\u1F427" # 🐧
elif [[ "$OS" == 'FreeBSD' ]]; then
LOGO="\u1F608" # 😈
fi
$1_prompt_segment $0 008 241 $LOGO
}
# rbenv information
prompt_rbenv() {
if [[ -n "$RBENV_VERSION" ]]; then

Loading…
Cancel
Save