[+] Add java, python, node version identification

This commit is contained in:
Azalea (on HyDEV-Daisy) 2022-08-29 20:01:29 -04:00
parent bed98253b4
commit 7a1b4b76d4
No known key found for this signature in database
GPG key ID: E289FAC0DA92DD2B

View file

@ -88,6 +88,10 @@ print_info() {
# info "Users" users
# info "Locale" locale # This only works on glibc systems.
# info "Java" java_ver
# info "Python" python_ver
# info "Node" node_ver
info cols
}
@ -3826,6 +3830,30 @@ get_cursor() {
cursor="$theme"
}
get_java_ver() {
if command -v java &> /dev/null; then
java_ver=$(java -version 2>&1)
java_ver=${java_ver%\"*}
java_ver=${java_ver#*\"}
fi
}
get_python_ver() {
if command -v python &> /dev/null; then
python_ver=$(python -VVV)
python_ver=${python_ver//$'\n'/}
python_ver=${python_ver//\(+([^\)])\)}
python_ver=$(echo "$python_ver" | awk '$1=$1')
fi
}
get_node_ver() {
if command -v node &> /dev/null; then
node_ver=$(node --version)
node_ver=${node_ver#v}
fi
}
get_term() {
# If function was run, stop here.
((term_run == 1)) && return