From 80cfab71f121c7c12fbde7386b1cf4bed4265aab Mon Sep 17 00:00:00 2001 From: Harald Hope Date: Mon, 20 Nov 2023 18:22:11 -0800 Subject: [PATCH] -I row redo --- pinxi | 65 ++++++++++++++++++++++++++++++++++------------------------- 1 file changed, 38 insertions(+), 27 deletions(-) diff --git a/pinxi b/pinxi index 0b4c5b0..c207891 100755 --- a/pinxi +++ b/pinxi @@ -50,8 +50,8 @@ use POSIX qw(ceil uname strftime ttyname); ## INXI INFO ## my $self_name='pinxi'; my $self_version='3.3.31'; -my $self_date='2023-11-18'; -my $self_patch='12'; +my $self_date='2023-11-20'; +my $self_patch='13'; ## END INXI INFO ## my ($b_pledge,@pledges); @@ -7402,7 +7402,7 @@ sub print_data { } $start_holder = $key; $indent_2 = $indent + $size{'indents'}; - $b_ni2 = ($start_holder eq 'Info') ? 1 : 0; + $b_ni2 = 0; # ($start_holder eq 'Info') ? 1 : 0; if ($indent < 10){ $line = "$start\n"; print_line($line); @@ -36481,33 +36481,32 @@ sub short_output { sub info_item { eval $start if $b_log; my $num = 0; - my $gcc_alt = ''; my $running_in = ''; my $data_name = main::key($prefix++,1,0,'Info'); - my ($b_gcc,$gcc,$index); + my ($index); my ($available,$gpu_ram,$parent,$percent,$used) = ('',0,'','',''); - my $gccs = main::get_gcc_data(); - if (@$gccs){ - $gcc = shift @$gccs; - if ($extra > 1 && @$gccs){ - $gcc_alt = join('/', @$gccs); - } - $b_gcc = 1; - $gcc ||= 'N/A'; # should not be needed after fix but leave in case undef - } my $data = { - $data_name => [{ - main::key($num++,0,1,'Processes') => scalar @ps_aux, - main::key($num++,1,1,'Uptime') => main::get_uptime(), - },], + $data_name => [{}], }; - $index = scalar(@{$data->{$data_name}}) - 1; + $index = 0; + if (!$loaded{'memory'}){ + main::MemoryData::row('info',$data->{$data_name}[$index],\$num,1); + } + $index++; + $data->{$data_name}[$index]{main::key($num++,0,1,'Processes')} = scalar @ps_aux; + $data->{$data_name}[$index]{main::key($num++,1,1,'Uptime')} = main::get_uptime(); +# $data = { +# $data_name => [{ +# main::key($num++,0,1,'Processes') => scalar @ps_aux, +# main::key($num++,1,1,'Uptime') => main::get_uptime(), +# },], +# }; + # $index = scalar(@{$data->{$data_name}}); if ($extra > 2){ my $wakeups = main::get_wakeups(); $data->{$data_name}[$index]{main::key($num++,0,2,'wakeups')} = $wakeups if defined $wakeups; } if (!$loaded{'memory'}){ - my $row = {}; main::MemoryData::row('info',$data->{$data_name}[$index],\$num,1); } if ($gpu_ram){ @@ -36541,8 +36540,25 @@ sub info_item { } } } + $index++ if $extra > 0; + if ($extra > 0 && !$loaded{'package-data'}){ + my $packages = PackageData::get('inner',\$num); + + for (keys %$packages){ + $data->{$data_name}[$index]{$_} = $packages->{$_}; + } + } if ($extra > 0){ - my $b_clang; + my ($b_clang,$b_gcc,$gcc,$gcc_alt); + my $gccs = main::get_gcc_data(); + if (@$gccs){ + $gcc = shift @$gccs; + if ($extra > 1 && @$gccs){ + $gcc_alt = join('/', @$gccs); + } + $b_gcc = 1; + $gcc ||= 'N/A'; # should not be needed after fix but leave in case undef + } my $clang_version = ''; if (my $path = main::check_program('clang')){ $clang_version = main::program_version($path,'clang',3,'--version'); @@ -36561,12 +36577,7 @@ sub info_item { $data->{$data_name}[$index]{main::key($num++,0,2,'clang')} = $clang_version; } } - if ($extra > 0 && !$loaded{'package-data'}){ - my $packages = PackageData::get('inner',\$num); - for (keys %$packages){ - $data->{$data_name}[$index]{$_} = $packages->{$_}; - } - } + # $index++ if $extra > 1 && !$loaded{'shell-data'}; if (!$loaded{'shell-data'} && $ppid && (!$b_irc || !$client{'name-print'})){ ShellData::set(); }