mirror of
https://github.com/romkatv/powerlevel10k.git
synced 2024-11-14 09:00:07 +00:00
Determine the right OS-Icon only once.
This commit is contained in:
parent
5a6b6ef604
commit
c116ead6aa
1 changed files with 25 additions and 15 deletions
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue