mirror of
https://github.com/romkatv/powerlevel10k.git
synced 2024-11-22 04:10:07 +00:00
Merge branch 'dritter/os_detection' of local staging.
This commit is contained in:
commit
fb9dbe86f7
2 changed files with 42 additions and 27 deletions
|
@ -45,6 +45,7 @@ this theme focus on three primary goals:
|
||||||
- [Symbols](#symbols)
|
- [Symbols](#symbols)
|
||||||
- [Styling](#styling)
|
- [Styling](#styling)
|
||||||
- [Double-Lined Prompt](#double-lined-prompt)
|
- [Double-Lined Prompt](#double-lined-prompt)
|
||||||
|
- [Disable Right Prompt](#disable-right-prompt)
|
||||||
- [Light Color Theme](#light-color-theme)
|
- [Light Color Theme](#light-color-theme)
|
||||||
- [Segment Color Customization](#segment-color-customization)
|
- [Segment Color Customization](#segment-color-customization)
|
||||||
- [Special Segment Colors](#special-segment-colors)
|
- [Special Segment Colors](#special-segment-colors)
|
||||||
|
@ -361,6 +362,12 @@ following variables in your `~/.zshrc`:
|
||||||
POWERLEVEL9K_MULTILINE_FIRST_PROMPT_PREFIX="↱"
|
POWERLEVEL9K_MULTILINE_FIRST_PROMPT_PREFIX="↱"
|
||||||
POWERLEVEL9K_MULTILINE_SECOND_PROMPT_PREFIX="↳ "
|
POWERLEVEL9K_MULTILINE_SECOND_PROMPT_PREFIX="↳ "
|
||||||
|
|
||||||
|
#### Disable Right Prompt
|
||||||
|
|
||||||
|
If you do not want a right prompt, you can disable it by setting:
|
||||||
|
|
||||||
|
POWERLEVEL9K_DISABLE_RPROMPT=true
|
||||||
|
|
||||||
#### Light Color Theme
|
#### Light Color Theme
|
||||||
|
|
||||||
If you prefer to use "light" colors, simply set `POWERLEVEL9K_COLOR_SCHEME`
|
If you prefer to use "light" colors, simply set `POWERLEVEL9K_COLOR_SCHEME`
|
||||||
|
|
|
@ -46,30 +46,12 @@
|
||||||
|
|
||||||
# OS detection, default to Linux
|
# OS detection, default to Linux
|
||||||
case $(uname) in
|
case $(uname) in
|
||||||
FreeBSD)
|
FreeBSD) OS=FreeBSD ;;
|
||||||
OS=FreeBSD
|
DragonFly) OS=FreeBSD ;;
|
||||||
OS_ICON=$'\U1F608' # 😈
|
OpenBSD) OS=OpenBSD ;;
|
||||||
;;
|
Darwin) OS=Darwin ;;
|
||||||
DragonFly)
|
SunOS) OS=SunOS ;;
|
||||||
OS=FreeBSD
|
*) OS=Linux ;;
|
||||||
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
|
esac
|
||||||
|
|
||||||
# The `CURRENT_BG` variable is used to remember what the last BG color used was
|
# The `CURRENT_BG` variable is used to remember what the last BG color used was
|
||||||
|
@ -95,6 +77,10 @@ case $POWERLEVEL9K_MODE in
|
||||||
OK_ICON="\U2713" # ✓
|
OK_ICON="\U2713" # ✓
|
||||||
FAIL_ICON="\U2718" # ✘
|
FAIL_ICON="\U2718" # ✘
|
||||||
SYMFONY_ICON="SF"
|
SYMFONY_ICON="SF"
|
||||||
|
APPLE_ICON=$'\UF8FF' #
|
||||||
|
FREEBSD_ICON=$'\U1F608 ' # 😈
|
||||||
|
LINUX_ICON=$'\U1F427 ' # 🐧
|
||||||
|
SUNOS_ICON=$'\U1F31E ' # 🌞
|
||||||
VCS_UNTRACKED_ICON="\UE16C" #
|
VCS_UNTRACKED_ICON="\UE16C" #
|
||||||
VCS_UNSTAGED_ICON="\UE17C" #
|
VCS_UNSTAGED_ICON="\UE17C" #
|
||||||
VCS_STAGED_ICON="\UE168" #
|
VCS_STAGED_ICON="\UE168" #
|
||||||
|
@ -108,7 +94,7 @@ case $POWERLEVEL9K_MODE in
|
||||||
VCS_TAG_ICON="\UE817 " #
|
VCS_TAG_ICON="\UE817 " #
|
||||||
VCS_BOOKMARK_ICON="\UE87B" #
|
VCS_BOOKMARK_ICON="\UE87B" #
|
||||||
VCS_COMMIT_ICON="\UE821 " #
|
VCS_COMMIT_ICON="\UE821 " #
|
||||||
VCS_BRANCH_ICON="\UE220" #
|
VCS_BRANCH_ICON=$'\UE220' #
|
||||||
VCS_REMOTE_BRANCH_ICON=" \UE804 " #
|
VCS_REMOTE_BRANCH_ICON=" \UE804 " #
|
||||||
VCS_GIT_ICON="\UE20E " #
|
VCS_GIT_ICON="\UE20E " #
|
||||||
VCS_HG_ICON="\UE1C3 " #
|
VCS_HG_ICON="\UE1C3 " #
|
||||||
|
@ -124,6 +110,10 @@ case $POWERLEVEL9K_MODE in
|
||||||
OK_ICON="\U2713" # ✓
|
OK_ICON="\U2713" # ✓
|
||||||
FAIL_ICON="\U2718" # ✘
|
FAIL_ICON="\U2718" # ✘
|
||||||
SYMFONY_ICON="SF"
|
SYMFONY_ICON="SF"
|
||||||
|
APPLE_ICON='OSX'
|
||||||
|
FREEBSD_ICON='BSD'
|
||||||
|
LINUX_ICON='Lx'
|
||||||
|
SUNOS_ICON='Sun'
|
||||||
VCS_UNTRACKED_ICON='?'
|
VCS_UNTRACKED_ICON='?'
|
||||||
VCS_UNSTAGED_ICON="\U25CF" # ●
|
VCS_UNSTAGED_ICON="\U25CF" # ●
|
||||||
VCS_STAGED_ICON="\U271A" # ✚
|
VCS_STAGED_ICON="\U271A" # ✚
|
||||||
|
@ -151,6 +141,10 @@ case $POWERLEVEL9K_MODE in
|
||||||
OK_ICON="\U2713" # ✓
|
OK_ICON="\U2713" # ✓
|
||||||
FAIL_ICON="\U2718" # ✘
|
FAIL_ICON="\U2718" # ✘
|
||||||
SYMFONY_ICON="SF"
|
SYMFONY_ICON="SF"
|
||||||
|
APPLE_ICON=$'\UF8FF' #
|
||||||
|
FREEBSD_ICON=$'\U1F608 ' # 😈
|
||||||
|
LINUX_ICON=$'\U1F427 ' # 🐧
|
||||||
|
SUNOS_ICON=$'\U1F31E ' # 🌞
|
||||||
VCS_UNTRACKED_ICON="\UE16C" #
|
VCS_UNTRACKED_ICON="\UE16C" #
|
||||||
VCS_UNSTAGED_ICON="\UE17C" #
|
VCS_UNSTAGED_ICON="\UE17C" #
|
||||||
VCS_STAGED_ICON="\UE168" #
|
VCS_STAGED_ICON="\UE168" #
|
||||||
|
@ -164,7 +158,7 @@ case $POWERLEVEL9K_MODE in
|
||||||
VCS_TAG_ICON="\UE817 " #
|
VCS_TAG_ICON="\UE817 " #
|
||||||
VCS_BOOKMARK_ICON="\UE87B" #
|
VCS_BOOKMARK_ICON="\UE87B" #
|
||||||
VCS_COMMIT_ICON="\UE821 " #
|
VCS_COMMIT_ICON="\UE821 " #
|
||||||
VCS_BRANCH_ICON="\UE220" #
|
VCS_BRANCH_ICON=$'\UE220' #
|
||||||
VCS_REMOTE_BRANCH_ICON=" \UE804 " #
|
VCS_REMOTE_BRANCH_ICON=" \UE804 " #
|
||||||
VCS_GIT_ICON="\UE20E " #
|
VCS_GIT_ICON="\UE20E " #
|
||||||
VCS_HG_ICON="\UE1C3 " #
|
VCS_HG_ICON="\UE1C3 " #
|
||||||
|
@ -182,6 +176,10 @@ case $POWERLEVEL9K_MODE in
|
||||||
OK_ICON="\U2713" # ✓
|
OK_ICON="\U2713" # ✓
|
||||||
FAIL_ICON="\U2718" # ✘
|
FAIL_ICON="\U2718" # ✘
|
||||||
SYMFONY_ICON="SF"
|
SYMFONY_ICON="SF"
|
||||||
|
APPLE_ICON='OSX'
|
||||||
|
FREEBSD_ICON='BSD'
|
||||||
|
LINUX_ICON='Lx'
|
||||||
|
SUNOS_ICON='Sun'
|
||||||
VCS_UNTRACKED_ICON='?'
|
VCS_UNTRACKED_ICON='?'
|
||||||
VCS_UNSTAGED_ICON="\U25CF" # ●
|
VCS_UNSTAGED_ICON="\U25CF" # ●
|
||||||
VCS_STAGED_ICON="\U271A" # ✚
|
VCS_STAGED_ICON="\U271A" # ✚
|
||||||
|
@ -527,6 +525,13 @@ prompt_node_version() {
|
||||||
|
|
||||||
# print a little OS icon
|
# print a little OS icon
|
||||||
prompt_os_icon() {
|
prompt_os_icon() {
|
||||||
|
case "$OS" in
|
||||||
|
"Darwin") OS_ICON=$APPLE_ICON ;;
|
||||||
|
"FreeBSD") OS_ICON=$FREEBSD_ICON ;;
|
||||||
|
"Linux") OS_ICON=$LINUX_ICON ;;
|
||||||
|
"SunOS") OS_ICON=$SUNOS_ICON ;;
|
||||||
|
*) OS_ICON='' ;;
|
||||||
|
esac
|
||||||
$1_prompt_segment "$0" "008" "241" "$OS_ICON"
|
$1_prompt_segment "$0" "008" "241" "$OS_ICON"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -682,7 +687,10 @@ $POWERLEVEL9K_MULTILINE_SECOND_PROMPT_PREFIX"
|
||||||
RPROMPT_PREFIX=''
|
RPROMPT_PREFIX=''
|
||||||
RPROMPT_SUFFIX=''
|
RPROMPT_SUFFIX=''
|
||||||
fi
|
fi
|
||||||
RPROMPT=$RPROMPT_PREFIX"%{%f%b%k%}"'$(build_right_prompt)'"%{$reset_color%}"$RPROMPT_SUFFIX
|
|
||||||
|
if [[ "$POWERLEVEL9K_DISABLE_RPROMPT" != true ]]; then
|
||||||
|
RPROMPT=$RPROMPT_PREFIX"%{%f%b%k%}"'$(build_right_prompt)'"%{$reset_color%}"$RPROMPT_SUFFIX
|
||||||
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
powerlevel9k_init "$@"
|
powerlevel9k_init "$@"
|
||||||
|
|
Loading…
Reference in a new issue