diff options
author | Dominik Ritter <dritter03@googlemail.com> | 2015-06-07 04:08:24 +0300 |
---|---|---|
committer | Dominik Ritter <dritter03@googlemail.com> | 2015-06-07 04:08:24 +0300 |
commit | 0993e7ce88f90367b543d4bf324023a352304fe8 (patch) | |
tree | b3792f24c1bd4ac8401e324002e2ed6d54461dcf /powerlevel9k.zsh-theme | |
parent | f7cb946898d501a273b4e193910dd5cac6ac22f1 (diff) |
New prompt segment `os_icon`.
Diffstat (limited to 'powerlevel9k.zsh-theme')
-rw-r--r-- | powerlevel9k.zsh-theme | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/powerlevel9k.zsh-theme b/powerlevel9k.zsh-theme index df0319c7..699a8195 100644 --- a/powerlevel9k.zsh-theme +++ b/powerlevel9k.zsh-theme @@ -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 |