diff --git a/inxi b/inxi index b493049..dedd12b 100755 --- a/inxi +++ b/inxi @@ -4071,11 +4071,9 @@ get_battery_data() } $1 ~ /^POWER_SUPPLY_ENERGY_FULL_DESIGN$/ { charge_full_design = $NF / 1000000 - charge_full_design = sprintf( "%.1f", charge_full_design ) } $1 ~ /^POWER_SUPPLY_ENERGY_FULL$/ { charge_full = $NF / 1000000 - charge_full = sprintf( "%.1f", charge_full ) } $1 ~ /^POWER_SUPPLY_ENERGY_NOW$/ { charge_now = $NF / 1000000 @@ -4083,7 +4081,7 @@ get_battery_data() } $1 ~ /^POWER_SUPPLY_CHARGE_FULL_DESIGN$/ { charge_full_design = $NF / 100000 - charge_full_design = sprintf( "%.1f", charge_full_design ) + } $1 ~ /^POWER_SUPPLY_CHARGE_FULL$/ { charge_full = $NF / 100000 @@ -4119,6 +4117,12 @@ get_battery_data() of_orig=100*charge_full/charge_full_design of_orig = sprintf( "%.0f%", of_orig ) } + if (charge_full_design != "" ){ + charge_full_design = sprintf( "%.1f", charge_full_design ) + } + if ( charge_full != "" ){ + charge_full = sprintf( "%.1f", charge_full ) + } entry = name "," status "," present "," chemistry "," cycles "," voltage_min_design "," voltage_now "," entry = entry power_now "," charge_full_design "," charge_full "," charge_now "," capacity "," entry = entry capacity_level "," of_orig "," model "," company "," serial "," location