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