From 7a1b4b76d45038670fb2054cacc121a2aac1a262 Mon Sep 17 00:00:00 2001 From: "Azalea (on HyDEV-Daisy)" Date: Mon, 29 Aug 2022 20:01:29 -0400 Subject: [PATCH] [+] Add java, python, node version identification --- neofetch | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/neofetch b/neofetch index 4981e2bd..1956a07a 100755 --- a/neofetch +++ b/neofetch @@ -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