summaryrefslogtreecommitdiff
path: root/powerlevel9k.zsh-theme
diff options
context:
space:
mode:
authorDominik Ritter <dritter03@googlemail.com>2015-07-27 01:20:40 +0300
committerDominik Ritter <dritter03@googlemail.com>2015-07-27 01:20:40 +0300
commitc116ead6aacb9c4c66529982ee420fa1bd6e8958 (patch)
tree43e32e1197b13bb4c8bd3b637dd9631b186ad273 /powerlevel9k.zsh-theme
parent5a6b6ef6042b9de2a3bc20c6de51c728ca210e15 (diff)
Determine the right OS-Icon only once.
Diffstat (limited to 'powerlevel9k.zsh-theme')
-rw-r--r--powerlevel9k.zsh-theme40
1 files changed, 25 insertions, 15 deletions
diff --git a/powerlevel9k.zsh-theme b/powerlevel9k.zsh-theme
index d7c2346a..5b8c4596 100644
--- a/powerlevel9k.zsh-theme
+++ b/powerlevel9k.zsh-theme
@@ -46,12 +46,30 @@
# 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 ;;
+ FreeBSD)
+ OS=FreeBSD
+ OS_ICON=$'\u1F608' # 😈
+ ;;
+ DragonFly)
+ OS=FreeBSD
+ OS_ICON=$'\u1F608' # 😈
+ ;;
+ OpenBSD)
+ OS=OpenBSD
+ OS_ICON=$'\u1F608' # 😈
+ ;;
+ Darwin)
+ OS=Darwin
+ OS_ICON=$'\uF8FF' # 
+ ;;
+ SunOS)
+ OS=SunOS
+ OS_ICON=$'\u1F31E' # 🌞
+ ;;
+ *)
+ OS=Linux
+ OS_ICON=$'\u1F427' # 🐧
+ ;;
esac
# The `CURRENT_BG` variable is used to remember what the last BG color used was
@@ -509,15 +527,7 @@ prompt_node_version() {
# 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"
+ $1_prompt_segment "$0" "008" "241" "$OS_ICON"
}
# rbenv information