From 121e07682e399641ee7f2409b32272082392f1f1 Mon Sep 17 00:00:00 2001 From: Harald Hope Date: Thu, 29 Nov 2018 21:23:15 -0800 Subject: [PATCH] New version, new man. Fixes, enhancements. Bugs: 1. ARM fix, odroid > 1 cpu speeds not showing correctly. 2. Ansible start fixes. 3. Fringe Battery failures, see Pinebook. Fixes: 1. Removed null data message 'old system' since that's not always the case. 2. Added support for > 1 CPU speeds in systems with > 1 CPU. 3. Added is_numeric test for sudo version tests, that was tripping errors in rare cases. 4. Fine tuned terminal size setting to check that is int to correct the Ansible problem. 5. ARM Pinebook fixes, battery, cpu. This also fixes corner cases where the battery charge state is missing but it is a systme battery. Enhancments: 1. Added more disk ID matches/vendors. Thanks LinuxLite Hardware database!! 2. UKUI, ukwm, ukui-panel added to desktop data. 3. Added PopOS to system base. 4. Ansible/Chef user noted that inxi believes that it is running in IRC when started by Ansible / Chef (not sure about Chef but assuming it's the same). Added flag --tty flag to force inxi to believe it's running in shell no matter what starts it. Note that this fix is not confirmed because the person didn't confirm the fix. Annoying. 5. Added Ubuntu disco to ubuntu_id. --- inxi | 161 ++++++++++++++++++++++++++++++++----------------- inxi.1 | 9 ++- inxi.changelog | 38 ++++++++++++ 3 files changed, 152 insertions(+), 56 deletions(-) diff --git a/inxi b/inxi index 406b842..b610d3c 100755 --- a/inxi +++ b/inxi @@ -31,8 +31,8 @@ use POSIX qw(uname strftime ttyname); ## INXI INFO ## my $self_name='inxi'; -my $self_version='3.0.27'; -my $self_date='2018-10-14'; +my $self_version='3.0.28'; +my $self_date='2018-11-28'; my $self_patch='00'; ## END INXI INFO ## @@ -324,7 +324,7 @@ sub check_tools { my @data = program_values('sudo'); my $version = program_version($path,$data[0],$data[1],$data[2],$data[5]); $version =~ s/^([0-9]+\.[0-9]+).*/$1/; - $sudo = "$path -n " if $version >= 1.7; + $sudo = "$path -n " if is_numeric($version) && $version >= 1.7; } set_fake_tools() if $b_fake_bsd; } @@ -376,7 +376,7 @@ sub set_display_width { } # print "tc: $size{'term'} cmc: $size{'console'}\n"; # double check, just in case it's missing functionality or whatever - if ( $size{'term'} == 0 || $size{'term'} !~ /\d/ ){ + if ( $size{'term'} == 0 || !is_int($size{'term'}) ){ $size{'term'}=80; # we'll be using this for terminal dimensions later so don't set default. # $size{'term-lines'}=100; @@ -3342,6 +3342,8 @@ sub program_values { 'tvtwm' => ['^tvtwm',0,'0','tvtwm',0,1,0], 'twin' => ['^Twin:',2,'--version','Twin',0,0,0], 'twm' => ['^twm',0,'0','twm',0,1,0], + 'ukui' => ['^ukui-session',2,'--version','UKUI',0,1,0], + 'ukwm' => ['^ukwm',2,'--version','ukwm',0,1,0], 'unagi' => ['^unagi',0,'0','unagi',0,1,0], 'unity' => ['^unity',2,'--version','Unity',0,1,0], 'unity-system-compositor' => ['^unity-system-compositor',2,'--version','unity-system-compositor (mir)',0,0,0], @@ -4269,13 +4271,14 @@ sub get_options{ }}, 'ppc' => sub { $b_ppc = 1 }, - 'recommends' => sub { $b_recommends = 1; }, 'sparc' => sub { $b_sparc = 1; }, 'sys-debug' => sub { $debugger{'sys-force'} = 1; }, + 'tty' => sub { # workaround for ansible running this + $b_irc = 0; }, 'U|update:s' => sub { # 1,2,3 OR http://myserver/path/inxi my ($opt,$arg) = @_; $b_downloader = 1; @@ -4702,6 +4705,9 @@ sub show_options { ['1', '', '--sleep', "[0-x.x] Change CPU sleep time, in seconds, for -C (default:^$cpu_sleep). Allows system to catch up and show a more accurate CPU use. Example:^$self_name^-Cxxx^--sleep^0.15" ], + ['1', '', '--tty', "Forces irc flag to false. Useful for running Ansible or Chef. + Must use -y [width] option if you want a specific output width. Always put this option + first in an option list."], ['1', '', '--usb-sys', "Force USB data to use /sys as data source (Linux only)." ], ['1', '', '--usb-tool', "Force USB data to use lsusb as data source (Linux only)." ], ['1', '', '--wm', "Force wm: to use wmctrl as data source. Default uses ps." ], @@ -5336,7 +5342,7 @@ sub row_defaults { 'arm-cpu-f' => 'Use -f option to see features', 'arm-pci' => "No ARM data found for this feature.", 'battery-data' => "No system battery data found. Is one present?", - 'battery-data-sys' => "No /sys data found. Old system?", + 'battery-data-sys' => "No /sys data found.", 'cpu-bugs-null' => "No CPU vulnerability/bugs data available.", 'cpu-model-null' => "Model N/A", 'cpu-speeds' => "No speed data found for $id cores.", @@ -5347,7 +5353,7 @@ sub row_defaults { 'display-console' => 'No advanced graphics data found on this system in console.', 'display-null' => 'No advanced graphics data found on this system.', 'display-root' => 'Advanced graphics data unavailable in console for root.', - 'display-root-x' => 'Advanced graphics data unavailable for root. Old System?', + 'display-root-x' => 'Advanced graphics data unavailable for root.', 'display-server' => "No display server data found. Headless machine?", 'glxinfo-missing' => "Unable to show advanced data. Required tool glxinfo missing.", 'display-try' => 'Advanced graphics data unavailable in console. Try -G --display', @@ -6152,7 +6158,16 @@ sub create_output { next if !$battery{$key}{'purpose'} || $battery{$key}{'purpose'} ne 'primary'; # $battery{$key}{''}; # we need to handle cases where charge or energy full is 0 - $charge = (defined $battery{$key}{'energy_now'} && $battery{$key}{'energy_now'} ne '') ? "$battery{$key}{'energy_now'} Wh" : 'N/A'; + if (defined $battery{$key}{'energy_now'} && $battery{$key}{'energy_now'} ne ''){ + $charge = "$battery{$key}{'energy_now'} Wh"; + } + # better than nothing, shows the charged percent + elsif (defined $battery{$key}{'capacity'} && $battery{$key}{'capacity'} ne ''){ + $charge = $battery{$key}{'capacity'} . '%' + } + else { + $charge = 'N/A'; + } if ($battery{$key}{'energy_full'} || $battery{$key}{'energy_full_design'}){ $battery{$key}{'energy_full_design'} ||= 'N/A'; $battery{$key}{'energy_full'}= (defined $battery{$key}{'energy_full'} && $battery{$key}{'energy_full'} ne '') ? $battery{$key}{'energy_full'} : 'N/A'; @@ -6279,8 +6294,9 @@ sub battery_data_sys { # 'type' is generic, like: Battery, Mains # capacity_level is a string, like: Normal my @items = qw(alarm capacity capacity_level charge_full charge_full_design charge_now - cycle_count energy_full energy_full_design energy_now location manufacturer model_name - power_now present serial_number status technology type voltage_min_design voltage_now); + constant_charge_current constant_charge_current_max cycle_count + energy_full energy_full_design energy_now location manufacturer model_name + power_now present scope serial_number status technology type voltage_min_design voltage_now); foreach $item (@batteries){ $b_ma = 0; $id = $item; @@ -6311,8 +6327,9 @@ sub battery_data_sys { } # note: the following 3 were off, 100000 instead of 1000000 # why this is, I do not know. I did not document any reason for that - # so going on assumption it is a mistake. CHARGE is mAh, which are converted - # to Wh by: mAh x voltage. Note: voltage fluctuates so will make results vary slightly. + # so going on assumption it is a mistake. + # CHARGE is mAh, which are converted to Wh by: mAh x voltage. + # Note: voltage fluctuates so will make results vary slightly. elsif ($file eq 'charge_full_design'){ $value = $value/1000000; $b_ma = 1; @@ -6346,7 +6363,8 @@ sub battery_data_sys { if ($id =~ /^(BAT|CMB).*$/i || ( $battery{$id}{'energy_full'} || $battery{$id}{'charge_full'} || $battery{$id}{'energy_now'} || $battery{$id}{'charge_now'} || - $battery{$id}{'energy_full_design'} || $battery{$id}{'charge_full_design'} ) ){ + $battery{$id}{'energy_full_design'} || $battery{$id}{'charge_full_design'} ) || + $battery{$id}{'voltage_min_design'} || $battery{$id}{'voltage_now'} ){ $battery{$id}{'purpose'} = 'primary'; } else { @@ -6386,6 +6404,7 @@ sub battery_data_sys { $battery{$id}{'energy_full'} = sprintf( "%.1f", $battery{$id}{'energy_full'} ); } } + main::log_data('dump','sys: %battery',\%battery) if $b_log; eval $end if $b_log; return %battery; } @@ -6435,6 +6454,7 @@ sub battery_data_dmi { } } # print Data::Dumper::Dumper \%battery; + main::log_data('dump','dmi: %battery',\%battery) if $b_log; eval $end if $b_log; return %battery; } @@ -6463,6 +6483,7 @@ sub upower_data { } } } + main::log_data('dump','upower: %data',\%data) if $b_log; eval $end if $b_log; return %data; } @@ -7527,7 +7548,7 @@ sub cpu_speeds { } sub set_cpu_speeds_sys { eval $start if $b_log; - my (@arm,%speeds); + my (@max_freq,@min_freq,@policies,%speeds); my $sys = '/sys/devices/system/cpu/cpufreq/policy0'; my $sys2 = '/sys/devices/system/cpu/cpu0/cpufreq/'; my ($cur,$min,$max) = ('scaling_cur_freq','scaling_min_freq','scaling_max_freq'); @@ -7549,40 +7570,51 @@ sub set_cpu_speeds_sys { $speeds{'max-freq'} = (main::reader("$sys/$max"))[0]; $speeds{'max-freq'} = speed_cleaner($speeds{'max-freq'},'khz'); } - if ($b_arm){ - @arm = main::globber('/sys/devices/system/cpu/cpufreq/policy*/'); + if ($b_arm || $b_mips){ + @policies = main::globber('/sys/devices/system/cpu/cpufreq/policy*/'); # there are arm chips with two dies, that run at different min max speeds!! # see: https://github.com/smxi/inxi/issues/128 # it would be slick to show both die min/max/cur speeds, but this is # ok for now. - if (scalar @arm > 1){ + if (scalar @policies > 1){ my ($current,$cur_temp,$max,$max_temp,$min,$min_temp) = (0,0,0,0,0,0); - foreach (@arm){ + foreach (@policies){ $_ =~ s/\/$//; # strip off last slash in case globs have them - $max_temp = (-r "$_/cpuinfo_max_freq") ? main::reader("$_/cpuinfo_max_freq") : 0; - $max_temp = speed_cleaner($max_temp,'khz') if $max_temp; - if ($max_temp > $max){ - $max = $max_temp; + $max_temp = (-r "$_/cpuinfo_max_freq") ? (main::reader("$_/cpuinfo_max_freq"))[0] : 0; + if ($max_temp){ + $max_temp = speed_cleaner($max_temp,'khz'); + push @max_freq, $max_temp; } - $min_temp = (-r "$_/cpuinfo_min_freq") ? main::reader("$_/cpuinfo_min_freq") : 0; - $min_temp = speed_cleaner($min_temp,'khz') if $min_temp; - if ($min_temp < $min || $min == 0){ - $min = $min_temp; + $max = $max_temp if ($max_temp > $max); + $min_temp = (-r "$_/cpuinfo_min_freq") ? (main::reader("$_/cpuinfo_min_freq"))[0] : 0; + if ($min_temp){ + $min_temp = speed_cleaner($min_temp,'khz'); + push @min_freq, $min_temp; } - $cur_temp = (-r "$_/cpuinfo_max_freq") ? main::reader("$_/cpuinfo_max_freq") : 0; + $min = $min_temp if ($min_temp < $min || $min == 0); + $cur_temp = (-r "$_/scaling_cur_freq") ? (main::reader("$_/scaling_cur_freq"))[0] : 0; $cur_temp = speed_cleaner($cur_temp,'khz') if $cur_temp; if ($cur_temp > $current){ $current = $cur_temp; } } + if (@max_freq){ + @max_freq = main::uniq(@max_freq); + $max = join ':', @max_freq; + } + if (@min_freq){ + @min_freq = main::uniq(@min_freq); + $min = join ':', @min_freq; + } $speeds{'cur-freq'} = $current if $current; $speeds{'max-freq'} = $max if $max; $speeds{'min-freq'} = $min if $min; } } - # policy4/cpuinfo_max_freq:["2000000"] + # policy4/cpuinfo_max_freq:["2000000"] policy0/cpuinfo_max_freq:["1500000"] # policy4/cpuinfo_min_freq:["200000"] - if ((defined $speeds{'min-freq'} && defined $speeds{'max-freq'}) && + if ( (scalar @max_freq < 2 && scalar @min_freq < 2 ) && + (defined $speeds{'min-freq'} && defined $speeds{'max-freq'}) && ($speeds{'min-freq'} > $speeds{'max-freq'} || $speeds{'min-freq'} == $speeds{'max-freq'} )){ $speeds{'min-freq'} = 0; } @@ -8618,6 +8650,7 @@ sub device_vendor { return if !$model; # 0 - match pattern; 1 - replace pattern; 2 - vendor print; 3 - serial pattern # Data URLs: inxi-resources.txt Section: DiskData device_vendor() + # $model = 'V Series SATA SS '; my @vendors = ( ## These go first because they are the most likely and common ## ['(Crucial|^(FC)?CT|-CT|^M4\b)','Crucial','Crucial',''], @@ -8626,25 +8659,25 @@ sub device_vendor { # must come before samsung MU. NOTE: toshiba can have: TOSHIBA_MK6475GSX: mush: MKNSSDCR120GB_ ['(^MKN|Mushkin)','Mushkin','Mushkin',''], # MKNS # MU = Multiple_Flash_Reader too risky: |M[UZ][^L] - ['(SAMSUNG|^MCG[0-9]+GC|^MCC|^G2 Portable|^DUO\b|^SP[0-9][0-9])','SAMSUNG','Samsung',''], # maybe ^SM, ^HM + ['(SAMSUNG|^MCG[0-9]+GC|^MCC|^G2 Portable|^DUO\b|^P3|^SP[0-9][0-9])','SAMSUNG','Samsung',''], # maybe ^SM, ^HM ['(SanDisk|^SDS[S]?[DQ]|^SL([0-9]+)G|^AFGCE|ULTRA\sFIT|Clip Sport|Cruzer|^Extreme)','SanDisk','SanDisk',''], ['^STEC\b','^STEC\b','STEC',''], # ssd drive, must come before seagate ST test # real, SSEAGATE Backup+; XP1600HE30002 - ['(^ST[^T]|[S]?SEAGATE|^X[AFP]|^BUP|Expansion Desk|FreeAgent|GoFlex|Backup(\+|\s?Plus)\s?Hub)','[S]?SEAGATE','Seagate',''], - ['^(WD|Western Digital|My (Book|Passport)|\d*LPCX|Elements|M000|EARX|EFRX|\d*EAVS|0JD|JPVX)','(^WDC|Western\s?Digital)','Western Digital',''], + ['(^ST[^T]|[S]?SEAGATE|^X[AFP]|^5AS|^BUP|Expansion Desk|FreeAgent|GoFlex|Backup(\+|\s?Plus)\s?Hub)','[S]?SEAGATE','Seagate',''], + ['^(WD|Western Digital|My (Book|Passport)|\d*LPCX|Elements|M000|EARX|EFRX|\d*EAVS|0JD|JPVX|[0-9]+(BEV|AAK|AAV|AZL))','(^WDC|Western\s?Digital)','Western Digital',''], ## Then better known ones ## - ['^(A-DATA|ADATA|AXN)','^(A-DATA|ADATA)','A-Data',''], + ['^(A-DATA|ADATA|AXN|CH11)','^(A-DATA|ADATA)','A-Data',''], ['^ADTRON','^(ADTRON)','Adtron',''], ['^ASUS','^ASUS','ASUS',''], ['^ATP','^ATP[\s\-]','ATP',''], ['^(Corsair|Voyager)','^Corsair','Corsair',''], - ['^(FUJITSU|MP)','^FUJITSU','Fujitsu',''], + ['^(FUJITSU|MHV|MP)','^FUJITSU','Fujitsu',''], # note: 2012: wdc bought hgst ['^(HGST|Touro)','^HGST','HGST (Hitachi)',''], # HGST HUA - ['^(Hitachi|HDS|HDT|IC|HT|HU)','^Hitachi','Hitachi',''], + ['^(Hitachi|HD[ST]|DK[0-9]|IC|HT|HU)','^Hitachi','Hitachi',''], ['^Hoodisk','^Hoodisk','Hoodisk',''], # vb: VB0250EAVER but clashes with vbox; HP_SSD_S700_120G ;GB0500EAFYL GB starter too generic? - ['^(HP\b|MB0|GJ0|v210w)','^HP','HP',''], + ['^(HP\b|MB0|G[BJ]0|v[0-9]{3}[ow])','^HP','HP',''], ['^(LSD|Lexar|JumpDrive)','^Lexar','Lexar',''], # mmc-LEXAR_0xb016546c # OCZSSD2-2VTXE120G is OCZ-VERTEX2_3.5 ['^(OCZ|APOC|D2|DEN|DEN|DRSAK|EC188|FTNC|GFGC|MANG|MMOC|NIMC|NIMR|PSIR|TALOS2|TMSC|TRSAK)','^OCZ[\s\-]','OCZ',''], @@ -8656,19 +8689,23 @@ sub device_vendor { # note: seen: KXG50ZNV512G NVMe TOSHIBA 512GB | THNSN51T02DUK NVMe TOSHIBA 1024GB ['(^[S]?TOS|^THN|TOSHIBA|TransMemory)','[S]?TOSHIBA','Toshiba',''], # scsi-STOSHIBA_STOR.E_EDITION_ ## These go last because they are short and could lead to false ID, or are unlikely ## + # unknown: AL25744_12345678; ADP may be usb 2.5" adapter; udisk ['^Android','^Android','Android',''], # must come before AP|Apacer ['^APPLE','^APPLE','Apple',''], ['^(AP|Apacer)','^Apacer','Apacer',''], + ['^(ASMT|2115)','^ASMT','ASMedia',''], ['^BHT','^BHT','BHT',''], ['^BIWIN','^BIWIN','BIWIN',''], ['^BUFFALO','^BUFFALO','Buffalo',''], ['^CHN\b','','Zheino',''], ['^Colorful\b','^Colorful','Colorful',''], + ['^CSD','^CSD','CSD',''], ['^DGM','^DGM\b','DGM',''], + ['^DIGITAL\s?FILM','DIGITAL\s?FILM','Digital Film',''], ['^DREVO\b','^DREVO','Drevo',''], ['^(Eaget|V8$)','^Eaget','Eaget',''], - ['^EXCELSTOR','^EXCELSTOR( TECHNO(LOGY)?)?','Excelstor',''], + ['^EXCELSTOR','^EXCELSTOR( TECHNO(LOGY)?)?','ExcelStor',''], ['^Fantom','^Fantom( Drive[s]?)?','Fantom Drives',''], ['^FASTDISK','^FASTDISK','FASTDISK',''], ['^FORESEE','^FORESEE','Foresee',''], @@ -8688,8 +8725,10 @@ sub device_vendor { ['^(InnoDisk|Innolite)','^InnoDisk( Corp.)?','InnoDisk',''], ['^Innostor','^Innostor','Innostor',''], ['^Innovation','^Innovation','Innovation',''], + ['^(INM|Integral|V\s?Series)','^Integral(\s?Memory)?','Integral Memory',''], ['^(Intenso|(Alu|Mobile|Rainbow|Speed) Line)','^Intenso','Intenso',''], ['^(Iomega|ZIP\b)','^Iomega','Iomega',''], + ['^JingX','^JingX','JingX',''], #JingX 120G SSD - not confirmed, but guessing # NOTE: ITY2 120GB hard to find ['^JMicron','^JMicron','JMicron',''], #JMicron H/W raid ['^KingDian','^KingDian','KingDian',''], @@ -8698,11 +8737,12 @@ sub device_vendor { ['^KINGSHARE','^KINGSHARE','KingShare',''], ['^KingSpec','^KingSpec','KingSpec',''], ['^LDLC','^LDLC','LDLC',''], + ['^Lenovo','^Lenovo','Lenovo',''], ['^(LITE[\-]?ON[\s\-]?IT)','^LITE[\-]?ON[\s\-]?IT','LITE-ON IT',''], # LITEONIT_LSS-24L6G ['^(LITE[\-]?ON|PH6)','^LITE[\-]?ON','LITE-ON',''], # PH6-CE240-L ['^M-Systems','^M-Systems','M-Systems',''], ['^(MAXTOR)','^MAXTOR','Maxtor',''], # note M3 is usually maxtor, but can be samsung - ['^(MT|M5|Micron)','^Micron','Micron',''], + ['(^MT|^M5|^Micron|00-MT)','^Micron','Micron',''],# C400-MTFDDAK128MAM ['^MARVELL','^MARVELL','Marvell',''], ['^MDT\b','^MDT','MDT (rebuilt WD/Seagate)',''], # mdt rebuilds wd/seagate hdd ['^Medion','^Medion','Medion',''], @@ -8712,16 +8752,19 @@ sub device_vendor { ['^(PS[8F]|Patriot)','^Patriot','Patriot',''], ['^PIX[\s]?JR','^PIX[\s]?JR','Disney',''], ['^(PLEXTOR|PX-)','^PLEXTOR','Plextor',''], + ['^(PQI|Intelligent\s?Stick)','^PQI','PQI',''], ['QEMU','^[0-9]*QEMU( QEMU)?','QEMU',''], # 0QUEMU QEMU HARDDISK ['(^Quantum|Fireball)','^Quantum','Quantum',''], ['^QUMO','^QUMO','Qumo',''], ['^(R3|AMD\s?(RADEON)?)','AMD\s?(RADEON)?','AMD Radeon',''], # ssd ['^RENICE','^RENICE','Renice',''], + ['^(Ricoh|R5)','^Ricoh','Ricoh',''], ['^RIM[\s]','^RIM','RIM',''], ['^SigmaTel','^SigmaTel','SigmaTel',''], + ['^(Silicon\s?Power|SPPC|Silicon)','Silicon\s?Power','Silicon Power',''], ['Smartbuy','\s?Smartbuy','Smartbuy',''], # SSD Smartbuy 60GB - ['^SPPC','','Silicon Power',''], - ['^(SK\s?HYNIX|HFS)','^SK\s?HYNIX','SK Hynix',''], # HFS128G39TND-N210A + # HFS128G39TND-N210A; seen nvme with name in middle + ['(SK\s?HYNIX|^HFS)','\s?SK\s?HYNIX','SK Hynix',''], ['hynix','hynix','Hynix',''],# nvme middle of string, must be after sk hynix ['^SH','','Smart Modular Tech.',''], ['^(SMART( Storage Systems)?|TX)','^(SMART( Storage Systems)?)','Smart Storage Systems',''], @@ -9532,6 +9575,7 @@ sub display_compositor { ['sommelier','sommelier','','sommelier'], ['sway','sway','','sway'], ['swc','swc','','swc'], + ['ukwm','ukwm','','ukwm'], ['unagi','unagi','','unagi'], ['unity-system-compositor','unity-system-compositor','','unity-system-compositor'], ['way-cooler','way-cooler','','way-cooler'], @@ -13492,7 +13536,7 @@ sub get_repos_linux { @rows = (@rows,@data); } } - # void $xbps_dir_1 + # Void if (-d $xbps_dir_1 || -d $xbps_dir_2){ @files = main::globber("$xbps_dir_1*.conf"); @files = (@files,main::globber("$xbps_dir_2*.conf")) if -d $xbps_dir_2; @@ -15864,6 +15908,7 @@ sub get_env_de_data { [1,'pantheon','pantheon','pantheon',0,0], [1,'lumina','lumina','lumina-desktop',0,1], [0,'manokwari','manokwari','manokwari',1,0], + [1,'ukui','ukui','ukui-session',0,1], ); foreach my $ref (@desktops){ my @item = @$ref; @@ -16152,7 +16197,7 @@ sub get_wm_main { if ($b_xprop){ #KWIN_RUNNING $wms = 'amiwm|blackbox|bspwm|compiz|kwin_wayland|kwin_x11|kwin|marco|'; - $wms .= 'motif|muffin|openbox|herbstluftwm|twin|wm2|windowmaker|i3'; + $wms .= 'motif|muffin|openbox|herbstluftwm|twin|ukwm|wm2|windowmaker|i3'; foreach (@xprop){ if (/($wms)/){ $working = $1; @@ -16169,7 +16214,8 @@ sub get_wm_main { $wms .= 'twin|kwin_wayland|kwin_x11|kwin|lwm|matchbox-window-manager|marco|'; $wms .= 'muffin|deepin-mutter|mutter|deepin-metacity|metacity|mwm|'; $wms .= 'nawm|notion|openbox|orbital|perceptia|qtile|ratpoison|sawfish|scrotwm|spectrwm|'; - $wms .= 'sway|tvtwm|twm|way-?cooler|windowlab|WindowMaker|wm2|wmii2|wmii|wmx|xfwm4|xfwm5|xmonad'; + $wms .= 'sway|tvtwm|twm|ukwm|way-?cooler|windowlab|WindowMaker|wm2|wmii2|wmii|wmx|'; + $wms .= 'xfwm4|xfwm5|xmonad'; foreach (@ps_gui){ if (/^($wms)$/){ $working = $1; @@ -16237,7 +16283,7 @@ sub set_info_data { $pattern .= 'matchbox-panel|mate-panel|ourico|'; $pattern .= 'perlpanel|plank|plasma-desktop|plasma-netbook|polybar|pypanel|'; $pattern .= 'razor-panel|razorqt-panel|stalonetray|swaybar|taskbar|tint2|trayer|'; - $pattern .= 'vala-panel|wbar|wharf|wingpanel|witray|'; + $pattern .= 'ukui-panel|vala-panel|wbar|wharf|wingpanel|witray|'; $pattern .= 'xfce4-panel|xfce5-panel|xmobar|yabar'; if (@data = grep {/^($pattern)$/} @ps_gui ) { # only one entry per type, can be multiple @@ -16265,7 +16311,7 @@ sub set_xprop { # XFDESKTOP_IMAGE_FILE; XFCE_DESKTOP my $pattern = '^amiwm|blackbox_pid|bspwm|compiz|enlightenment|^_gnome|'; $pattern .= 'herbstluftwm|^kwin_|^i3_|icewm|_marco|moksha|^_motif|_muffin|'; - $pattern .= 'openbox_pid|^_?windowmaker|^_wm2|^(xfdesktop|xfce)'; + $pattern .= 'openbox_pid|^_ukwm|^_?windowmaker|^_wm2|^(xfdesktop|xfce)'; # let's only do these searches once @xprop = grep {/^\S/ && /($pattern)/i} @xprop; $_ = lc for @xprop; @@ -16570,7 +16616,7 @@ sub get_linux_distro { my $base_osr = 'aptosid|grml|siduction|bodhi'; # osr base, distro id in list of distro files my $base_osr_issue = 'grml|linux lite'; # osr base, distro id in issue # osr has distro name but has ubuntu ID_LIKE/UBUNTU_CODENAME - my $base_osr_ubuntu = 'mint|neon|nitrux|zorin'; + my $base_osr_ubuntu = 'mint|neon|nitrux|pop!_os|zorin'; my $base_upstream_lsb = '/etc/upstream-release/lsb-release'; my $base_upstream_osr = '/etc/upstream-release/os-release'; # first: try, some distros have upstream-release, elementary, new mint @@ -16602,7 +16648,7 @@ sub get_linux_distro { elsif ( grep {/($base_debian_version_osr)/i} @osr ){ $system_base = debian_id(); } - elsif ( grep {/($base_osr_ubuntu)/} @osr ){ + elsif ( grep {/($base_osr_ubuntu)/i} @osr ){ $base_type = 'ubuntu'; } elsif ( ( ($distro_id && $distro_id =~ /($base_osr_issue)/ ) || @@ -16720,7 +16766,8 @@ sub get_os_release { if ($base_type ){ if ($working[0] eq 'ID_LIKE' && $working[1]){ if ($base_type eq 'ubuntu'){ - $working[1] =~ s/ubuntu\sdebian/ubuntu/; + # popos shows debian + $working[1] =~ s/^(debian|ubuntu\sdebian|debian\subuntu)/ubuntu/; $working[1] = 'ubuntu' if $working[1] eq 'debian'; } $base_name = ucfirst($working[1]); @@ -16823,6 +16870,7 @@ sub ubuntu_id { $codename = lc($codename); my ($id) = (''); my %codenames = ( + 'disco' => '19.04', 'cosmic' => '18.10', 'bionic' => '18.04 LTS', 'artful' => '17.10', @@ -17882,6 +17930,7 @@ sub soc_devices { $chip_id = $5; $temp = $7; @working = main::reader($file, 'strip') if -r $file; + ($device,$driver,$handle,$type,$vendor_id) = (undef,undef,undef,undef,undef); foreach my $data (@working){ @temp2 = split /=/, $data; if ($temp2[0] eq 'DRIVER'){ @@ -17977,7 +18026,7 @@ sub assign_data { # $device_vm = check_vm($data[4]) if ( (!$b_ppc && !$b_mips) && !$device_vm ); @devices = (@devices,[@data]); } -# note: for soc, these have been converted in set_soc_type() +# note: for soc, these have been converted in soc_type() sub check_audio { if ( ( $_[1] && length($_[1]) == 4 && $_[1] =~/^04/ ) || ( $_[0] && $_[0] =~ /^(audio|hdmi|multimedia|sound)$/ )){ @@ -18017,8 +18066,10 @@ sub check_vm { sub soc_type { my ($type,$info,$driver) = @_; # I2S or i2s. I2C is i2 controller |[iI]2[Ss]. note: odroid hdmi item is sound only + # snd_soc_dummy. simple-audio-amplifier driver: speaker_amp if ($type =~ /^(daudio|.*hifi.*|.*sound[\-_]card|.*dac[0-9]?)$/ || - ($info && $info =~ /(sound|audio)/) || ($driver && $driver =~ /(audio|snd|sound)/) ){ + ($info && $info !~ /amp|codec|dummy/ && $info =~ /(sound|audio)/) || + ($driver && $driver !~ /(codec|dummy)/ && $driver =~ /(audio|snd|sound)/) ){ $type = 'audio'; } elsif ($type =~ /^((meson-?)?fb|disp|display(-[^\s]+)?|gpu|mali)$/){ @@ -18032,7 +18083,7 @@ sub soc_type { $type = 'wifi'; } # needs to catch variants like hdmi-tx but not hdmi-connector - elsif ($type =~ /^(.*hdmi(-?tx)?)$/){ + elsif ( (!$driver || $driver !~ /(codec|dummy)/) && $type =~ /^(.*hdmi(-?tx)?)$/){ $type = 'hdmi'; } elsif ($type =~ /^timer$/){ @@ -18434,7 +18485,7 @@ sub set_ps_gui { @temp=qw(budgie-wm compiz deepin-wm gala gnome-shell twin kwin_wayland kwin_x11 kwin marco deepin-metacity metacity metisse mir muffin deepin-mutter mutter - xfwm4 xfwm5); + ukwm xfwm4 xfwm5); @match = (@match,@temp); # startx: /bin/sh /usr/bin/startx @temp=qw(ly .*startx xinit); # possible dm values @@ -18449,8 +18500,8 @@ sub set_ps_gui { matchbox-panel mate-panel ourico perlpanel plank plasma-desktop plasma-netbook polybar pypanel razor-panel razorqt-panel stalonetray swaybar taskbar tint2 trayer - vala-panel wbar wharf wingpanel witray xfce4-panel xfce5-panel xmobar - yabar); + ukui-panel vala-panel wbar wharf wingpanel witray + xfce4-panel xfce5-panel xmobar yabar); @match = (@match,@temp); } # compositors (for wayland these are also the server, note @@ -18459,7 +18510,7 @@ sub set_ps_gui { enlightenment fireplace gnome-shell grefson kmscon kwin_wayland kwin_x11 liri marco metisse mir moblin motorcar muffin mutter orbital papyros perceptia rustland sommelier sway swc - unagi unity-system-compositor + ukwm unagi unity-system-compositor wavy waycooler way-cooler wayhouse westford weston xcompmgr); @match = (@match,@temp); } diff --git a/inxi.1 b/inxi.1 index 14a1ade..d882e5c 100644 --- a/inxi.1 +++ b/inxi.1 @@ -1,4 +1,4 @@ -.TH INXI 1 "2018\-10\-14" inxi "inxi manual" +.TH INXI 1 "2018\-11\-28" inxi "inxi manual" .SH NAME inxi \- Command line system information script for console and IRC .SH SYNOPSIS @@ -1010,6 +1010,13 @@ Overrides default internal value and user configuration value: \fBCPU_SLEEP=0.25\fR +.TP +.B \-\-tty\fR +Forces internal IRC flag to off. Useful for running in Ansible or Chef, where the +program may not be seen as a shell/tty, but it is not an IRC client. Put +\fB\-\-tty\fR first in option list to avoid unexpected errors. If you want a specific +output with, use the \fB\-\-width\fR option. + .TP .B \-\-usb\-sys\fR Forces the USB data generator to use \fB/sys\fR as data source diff --git a/inxi.changelog b/inxi.changelog index 8f70790..c6828fc 100644 --- a/inxi.changelog +++ b/inxi.changelog @@ -1,3 +1,41 @@ +===================================================================================== +Version: 3.0.28 +Patch: 00 +Date: 2018-11-28 +----------------------------------- +Changes: +----------------------------------- +New version, new man. Fixes, enhancements. + +Bugs: +1. ARM fix, odroid > 1 cpu speeds not showing correctly. +2. Ansible start fixes. +3. Fringe Battery failures, see Pinebook. + +Fixes: +1. Removed null data message 'old system' since that's not always the case. +2. Added support for > 1 CPU speeds in systems with > 1 CPU. +3. Added is_numeric test for sudo version tests, that was tripping errors in +rare cases. +4. Fine tuned terminal size setting to check that is int to correct the +Ansible problem. +5. ARM Pinebook fixes, battery, cpu. This also fixes corner cases where +the battery charge state is missing but it is a systme battery. + +Enhancments: +1. Added more disk ID matches/vendors. Thanks LinuxLite Hardware database!! +2. UKUI, ukwm, ukui-panel added to desktop data. +3. Added PopOS to system base. +4. Ansible/Chef user noted that inxi believes that it is running in IRC when +started by Ansible / Chef (not sure about Chef but assuming it's the same). +Added flag --tty flag to force inxi to believe it's running in shell no matter +what starts it. Note that this fix is not confirmed because the person didn't +confirm the fix. Annoying. +5. Added Ubuntu disco to ubuntu_id. + +----------------------------------- +-- Harald Hope - Thu, 29 Nov 2018 21:12:14 -0800 + ===================================================================================== Version: 3.0.27 Patch: 00