From 3ac997b8879f8dffcc805743243cf14c99986c13 Mon Sep 17 00:00:00 2001 From: inxi-svn Date: Sat, 18 Jun 2011 22:06:22 +0000 Subject: [PATCH] added to -S as -x option, kernel gcc version --- inxi | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/inxi b/inxi index 19a164f..f195088 100755 --- a/inxi +++ b/inxi @@ -1,7 +1,7 @@ #!/bin/bash ######################################################################## #### Script Name: inxi -#### version: 1.7.1 +#### version: 1.7.2 #### Date: June 17 2011 #### Patch Number: 00 ######################################################################## @@ -2119,7 +2119,7 @@ show_options() print_screen_output " -d - Adds items to features line of optical drive; adds rev version to optical drive." print_screen_output " -N -A - Adds version/port(s)/driver version (if available) for Network/Audio;" print_screen_output " -N -A -G - Network, audio, graphics, shows PCI Bus ID/Usb ID number of card;" - print_screen_output " -S - Desktop toolkit if avaliable (GNOME/XFCE/KDE only)" + print_screen_output " -S - Desktop toolkit if avaliable (GNOME/XFCE/KDE only); Kernel gcc version" print_screen_output " -G - Direct rendering status for Graphics (in X)." print_screen_output " -G - (for single gpu, nvidia driver) screen number gpu is running on." print_screen_output " -D - Hdd temp with disk data if you have hddtemp installed, if you are root OR if you have added to" @@ -3415,6 +3415,12 @@ get_distro_lsb_data() eval $LOGFE } +get_gcc_version() +{ + local gccVersion=$( grep -Eio 'gcc[[:space:]]*version[[:space:]]*([0-9\.]+)' /proc/version 2>/dev/null | grep -Eo '([0-9\.]+)' ) + echo $gccVersion +} + get_gpu_temp_data() { local gpu_temp='' gpu_fan='' screens='' screen_nu='' gpu_temp_looper='' @@ -7354,7 +7360,13 @@ print_system_data() host_string="${C1}Host${C2} $host_name " system_data=$( create_print_line "System:" "${C1}Host${C2} $host_name ${C1}Kernel${C2}" ) fi - host_kernel_string="$host_string${C1}Kernel${C2} $current_kernel $bits " + if [[ $B_EXTRA_DATA == 'true' ]];then + gcc_string=$( get_gcc_version ) + if [[ -n $gcc_string ]];then + gcc_string=" ${C1}gcc${C2} $gcc_string" + fi + fi + host_kernel_string="$host_string${C1}Kernel${C2} $current_kernel $bits$gcc_string " if [[ $( wc -c <<< "$host_kernel_string$de_distro_string" ) -lt $line_max ]];then system_data="$host_kernel_string$de_distro_string"