mirror of
https://github.com/romkatv/powerlevel10k.git
synced 2024-11-11 00:00:06 +00:00
New prompt segment os_icon
.
This commit is contained in:
parent
f7cb946898
commit
0993e7ce88
1 changed files with 23 additions and 0 deletions
|
@ -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…
Reference in a new issue