mirror of
https://github.com/smxi/inxi.git
synced 2024-11-17 00:31:19 +00:00
made 2 line output, for fans and temps
This commit is contained in:
parent
c911060396
commit
d9b0fde91a
23
inxi
23
inxi
|
@ -1,7 +1,7 @@
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
########################################################################
|
########################################################################
|
||||||
#### Script Name: inxi
|
#### Script Name: inxi
|
||||||
#### version: 1.0.95-b1
|
#### version: 1.0.96-b1
|
||||||
#### Date: 27 July 2009
|
#### Date: 27 July 2009
|
||||||
########################################################################
|
########################################################################
|
||||||
#### SPECIAL THANKS
|
#### SPECIAL THANKS
|
||||||
|
@ -4057,26 +4057,27 @@ print_sensors_data()
|
||||||
{
|
{
|
||||||
eval $LOGFS
|
eval $LOGFS
|
||||||
local mobo_temp='' cpu_temp='' cpu_fan='' sys_fan1='' sys_fan2='' sys_fan3=''
|
local mobo_temp='' cpu_temp='' cpu_fan='' sys_fan1='' sys_fan2='' sys_fan3=''
|
||||||
local ps_fan='' sensors_data=''
|
local ps_fan='' temp_data='' fan_data='' b_is_error='false'
|
||||||
get_sensors_data
|
get_sensors_data
|
||||||
|
|
||||||
# initial error cases, for missing app or unconfigured sensors
|
# initial error cases, for missing app or unconfigured sensors
|
||||||
if [[ ${#A_SENSORS_DATA[@]} -eq 1 ]];then
|
if [[ ${#A_SENSORS_DATA[@]} -eq 1 ]];then
|
||||||
mobo_temp=${A_SENSORS_DATA[0]}
|
mobo_temp=${A_SENSORS_DATA[0]}
|
||||||
|
b_is_error='true'
|
||||||
else
|
else
|
||||||
if [[ -n ${A_SENSORS_DATA[0]} ]];then
|
if [[ -n ${A_SENSORS_DATA[0]} ]];then
|
||||||
mobo_temp=${A_SENSORS_DATA[0]}
|
mobo_temp=${A_SENSORS_DATA[0]}
|
||||||
else
|
else
|
||||||
mobo_temp='N/A'
|
mobo_temp='N/A'
|
||||||
fi
|
fi
|
||||||
mobo_temp="${C1}Mobo Temp:${C2} $mobo_temp "
|
mobo_temp="${C1}System Temperatures: mobo:${C2} $mobo_temp "
|
||||||
|
|
||||||
if [[ -n ${A_SENSORS_DATA[1]} ]];then
|
if [[ -n ${A_SENSORS_DATA[1]} ]];then
|
||||||
cpu_temp=${A_SENSORS_DATA[1]}
|
cpu_temp=${A_SENSORS_DATA[1]}
|
||||||
else
|
else
|
||||||
cpu_temp='N/A'
|
cpu_temp='N/A'
|
||||||
fi
|
fi
|
||||||
cpu_temp="${C1}Cpu Temp:${C2} $cpu_temp "
|
cpu_temp="${C1}cpu:${C2} $cpu_temp "
|
||||||
|
|
||||||
# we need to make sure it's either cpu fan OR cpu fan and sys fan 1
|
# we need to make sure it's either cpu fan OR cpu fan and sys fan 1
|
||||||
if [[ -n ${A_SENSORS_DATA[2]} ]];then
|
if [[ -n ${A_SENSORS_DATA[2]} ]];then
|
||||||
|
@ -4086,7 +4087,7 @@ print_sensors_data()
|
||||||
else
|
else
|
||||||
cpu_fan='N/A'
|
cpu_fan='N/A'
|
||||||
fi
|
fi
|
||||||
cpu_fan="${C1}:: FANS(rpm): cpu:${C2} $cpu_fan "
|
cpu_fan="${C1}Fan Speeds (rpm): cpu:${C2} $cpu_fan "
|
||||||
# then set the sys fans, if present or 0. sys fan 1 only if cpu fan is present,
|
# then set the sys fans, if present or 0. sys fan 1 only if cpu fan is present,
|
||||||
# otherwise fan1: is cpu fan
|
# otherwise fan1: is cpu fan
|
||||||
if [[ -n ${A_SENSORS_DATA[2]} && -n ${A_SENSORS_DATA[3]} ]];then
|
if [[ -n ${A_SENSORS_DATA[2]} && -n ${A_SENSORS_DATA[3]} ]];then
|
||||||
|
@ -4102,9 +4103,15 @@ print_sensors_data()
|
||||||
ps_fan="${C1}ps:${C2} ${A_SENSORS_DATA[6]} "
|
ps_fan="${C1}ps:${C2} ${A_SENSORS_DATA[6]} "
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
sensors_data="$mobo_temp$cpu_temp$cpu_fan$sys_fan1$sys_fan2$sys_fan3$ps_fan"
|
temp_data="$mobo_temp$cpu_temp"
|
||||||
sensors_data=$( create_print_line "Sensors:" "$sensors_data" )
|
temp_data=$( create_print_line "Sensors:" "$temp_data" )
|
||||||
print_screen_output "$sensors_data"
|
print_screen_output "$temp_data"
|
||||||
|
# don't print second or subsequent lines if error data
|
||||||
|
if [[ $b_is_error != 'true' ]];then
|
||||||
|
fan_data="$cpu_fan$sys_fan1$sys_fan2$sys_fan3$ps_fan"
|
||||||
|
fan_data=$( create_print_line " " "$fan_data" )
|
||||||
|
print_screen_output "$fan_data"
|
||||||
|
fi
|
||||||
eval $LOGFE
|
eval $LOGFE
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue