Added a segment that shows the Java version.

pull/22/head
Julien Roy 7 years ago
parent afb7387abe
commit b260adbc1b

@ -133,6 +133,8 @@ The segments that are currently available are:
* `rust_version` - Display the current rust version and [logo](https://www.rust-lang.org/logos/rust-logo-blk.svg). * `rust_version` - Display the current rust version and [logo](https://www.rust-lang.org/logos/rust-logo-blk.svg).
* **Swift Segments:** * **Swift Segments:**
* `swift_version` - Show the version number of the installed Swift. * `swift_version` - Show the version number of the installed Swift.
* **Java Segments:**
* `java_version` - Show the current Java version.
**Cloud Segments:** **Cloud Segments:**
* **AWS Segments:** * **AWS Segments:**

@ -87,6 +87,7 @@ case $POWERLEVEL9K_MODE in
SSH_ICON '(ssh)' SSH_ICON '(ssh)'
VPN_ICON '(vpn)' VPN_ICON '(vpn)'
KUBERNETES_ICON $'\U2388' # ⎈ KUBERNETES_ICON $'\U2388' # ⎈
JAVA_ICON $'\U2615' # ☕︎
) )
;; ;;
'awesome-fontconfig') 'awesome-fontconfig')
@ -158,6 +159,7 @@ case $POWERLEVEL9K_MODE in
SSH_ICON '(ssh)' SSH_ICON '(ssh)'
VPN_ICON $'\uF023' VPN_ICON $'\uF023'
KUBERNETES_ICON $'\U2388' # ⎈ KUBERNETES_ICON $'\U2388' # ⎈
JAVA_ICON $'\U2615' # ☕︎
) )
;; ;;
'nerdfont-complete'|'nerdfont-fontconfig') 'nerdfont-complete'|'nerdfont-fontconfig')
@ -229,6 +231,7 @@ case $POWERLEVEL9K_MODE in
SSH_ICON $'\uF489' #  SSH_ICON $'\uF489' # 
VPN_ICON '(vpn)' VPN_ICON '(vpn)'
KUBERNETES_ICON $'\U2388' # ⎈ KUBERNETES_ICON $'\U2388' # ⎈
JAVA_ICON $'\U2615' # ☕︎
) )
;; ;;
*) *)
@ -300,6 +303,7 @@ case $POWERLEVEL9K_MODE in
SSH_ICON '(ssh)' SSH_ICON '(ssh)'
VPN_ICON '(vpn)' VPN_ICON '(vpn)'
KUBERNETES_ICON $'\U2388' # ⎈ KUBERNETES_ICON $'\U2388' # ⎈
JAVA_ICON $'\U2615' # ☕︎
) )
;; ;;
esac esac

@ -1433,6 +1433,15 @@ prompt_kubecontext() {
fi fi
} }
# print Java version number
prompt_java_version() {
local java_version
java_version=$(java -fullversion 2>&1 | cut -d '"' -f 2)
if [[ -n "$java_version" ]]; then
"$1_prompt_segment" "$0" "$2" "red" "white" "$java_version" "JAVA_ICON"
fi
}
################################################################ ################################################################
# Prompt processing and drawing # Prompt processing and drawing

Loading…
Cancel
Save