From 824dab4b7728b0f044dac3a07a5e09672b53260f Mon Sep 17 00:00:00 2001 From: Harald Hope Date: Tue, 17 Apr 2018 13:28:16 -0700 Subject: [PATCH] New version, new man. Small new enhancements. 1. Added to -s for ipmi, with -x: voltage 12v,5v,3.3v,vbat; for -xx, dimm/soc p1/p2 voltages 2. enhanced wm: feature, needed more filters and protection against redundant data 3. basic apple osx fixes to keep it from crashing, but I'm not spending any more time on apple junk unless someone pays me for my time, I can't stand the product or company, it's the total antitheses of freedom or free software, or even openness. 4. openbsd/bsd fixes: openbsd was failing to get cpu flags due to a small oversight 5. -C now shows bits: for the true bits of cpu, not the kernel bits. This is not a reliable measurement but should be right about 95+ percent of the time, and basically all of the time for GNU/Linux on Intel/AMD, most of the time for ARM. When it doesn't know it does not guess, and shows N/A. 6. bsd fix for usb, was running numeric action on string value 7. fixed stderr tool for program_version, now it's hard-coded in program_values which removes an unneded regex search for every program version test. 8. Mate detection, switched to using mate-sesssion instead of mate-about, the latter is not getting updated and has the wrong version number on it. --- inxi | 436 +++++++++++++++++++++++++++++-------------------- inxi.1 | 14 +- inxi.changelog | 29 ++++ 3 files changed, 301 insertions(+), 178 deletions(-) diff --git a/inxi b/inxi index 823c7f6..34a2c2f 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.04'; -my $self_date='2018-04-14'; +my $self_version='3.0.05'; +my $self_date='2018-04-17'; my $self_patch='00'; ## END INXI INFO ## @@ -56,8 +56,8 @@ my ( %alerts, %client, %colors, %dl, %files, %rows, %system_files, %use ); ## Arrays # ps_aux is full output, ps_cmd is only the last 10 to last -my (@app,@dmesg_boot,@dmi,@gpudata,@ifs,@ifs_bsd,@pci,@ps_aux,@ps_cmd, -@sysctl,@sysctl_battery,@sysctl_sensors,@sysctl_machine,@usb); +my (@app,@dmesg_boot,@dmi,@gpudata,@ifs,@ifs_bsd,@paths,@pci,@ps_aux,@ps_cmd, +@sysctl,@sysctl_battery,@sysctl_sensors,@sysctl_machine,@uname,@usb); ## Disk arrays my (@dm_boot_disk,@dm_boot_optical,@glabel,@gpart,@labels,@lsblk,@partitions, @raid,@sysctl_disks,@uuids); @@ -75,8 +75,8 @@ my ($b_sysctl_disk,$b_update,$b_weather) = (1,1,1); ## System my ($bsd_type,$language,$os) = ('','',''); my ($cpu_sleep,$dl_timeout,$limit,$ps_count,$usb_level) = (0.35,4,10,5,0); -my @paths = qw(/sbin /bin /usr/sbin /usr/bin /usr/local/sbin /usr/local/bin /usr/X11R6/bin); my $sensors_cpu_nu = 0; +my ($bits_sys); ## Tools my ($display,$ftp_alt,$tty_session); @@ -355,9 +355,16 @@ sub set_display_width { } # NOTE: most tests internally are against !$bsd_type sub set_os { - my @uname = uname(); + @uname = uname(); $os = lc($uname[0]); - $b_arm = 1 if $uname[-1] =~ /arm|aarch/i; + my $type = lc($uname[-1]); + $b_arm = 1 if $type =~ /arm|aarch/; + if ($type =~ /(armv[1-7]|aarch32|sparc_v9)/){ + $bits_sys = 32; + } + elsif ($type =~ /(alpha|64)/){ + $bits_sys = 64; + } if ( $os =~ /(bsd|dragonfly|darwin)/ ){ if ( $os =~ /openbsd/ ){ $os = 'openbsd'; @@ -379,6 +386,7 @@ sub set_os { sub set_path { # Extra path variable to make execute failures less likely, merged below my (@path); + @paths = qw(/sbin /bin /usr/sbin /usr/bin /usr/local/sbin /usr/local/bin /usr/X11R6/bin); @path = split /:/, $ENV{'PATH'} if $ENV{'PATH'}; # print "paths: @paths\nPATH: $ENV{'PATH'}\n"; # Create a difference of $PATH and $extra_paths and add that to $PATH: @@ -2876,95 +2884,97 @@ sub joiner { # returns array of: # 0 - match string; 1 - search number; 2 - version string; 3 - Print name -# 4 - console 0/1; 5 - 0/1 exit version loop at first iteration +# 4 - console 0/1; 5 - 0/1 exit version loop at first iteration; +# 6 - 0/1 write to stderr # arg: 1 - program lower case name sub program_values { my ($app) = @_; my (@client_data); my %data = ( ## Clients - 'bitchx' => ['bitchx',2,'','BitchX',1,0],# special - 'finch' => ['finch',2,'-v','Finch',1,1], - 'gaim' => ['[0-9.]+',2,'-v','Gaim',0,1], - 'ircii' => ['[0-9.]+',3,'-v','ircII',1,1], - 'irssi' => ['irssi',2,'-v','Irssi',1,1], - 'irssi-text' => ['irssi',2,'-v','Irssi',1,1], - 'konversation' => ['konversation',2,'-v','Konversation',0,0], - 'kopete' => ['Kopete',2,'-v','Kopete',0,0], - 'kvirc' => ['[0-9.]+',2,'-v','KVIrc',0,0], # special - 'pidgin' => ['[0-9.]+',2,'-v','Pidgin',0,1], - 'quassel' => ['',1,'-v','Quassel [M]',0,0], # special - 'quasselclient' => ['',1,'-v','Quassel',0,0],# special - 'quasselcore' => ['',1,'-v','Quassel (core)',0,0],# special - 'gribble' => ['^Supybot',2,'--version','Gribble',1,0],# special - 'limnoria' => ['^Supybot',2,'--version','Limnoria',1,0],# special - 'supybot' => ['^Supybot',2,'--version','Supybot',1,0],# special - 'weechat' => ['[0-9.]+',1,'-v','WeeChat',1,0], - 'weechat-curses' => ['[0-9.]+',1,'-v','WeeChat',1,0], - 'xchat-gnome' => ['[0-9.]+',2,'-v','X-Chat-Gnome',1,1], - 'xchat' => ['[0-9.]+',2,'-v','X-Chat',1,1], + 'bitchx' => ['bitchx',2,'','BitchX',1,0,0],# special + 'finch' => ['finch',2,'-v','Finch',1,1,0], + 'gaim' => ['[0-9.]+',2,'-v','Gaim',0,1,0], + 'ircii' => ['[0-9.]+',3,'-v','ircII',1,1,0], + 'irssi' => ['irssi',2,'-v','Irssi',1,1,0], + 'irssi-text' => ['irssi',2,'-v','Irssi',1,1,0], + 'konversation' => ['konversation',2,'-v','Konversation',0,0,0], + 'kopete' => ['Kopete',2,'-v','Kopete',0,0,0], + 'kvirc' => ['[0-9.]+',2,'-v','KVIrc',0,0,1], # special + 'pidgin' => ['[0-9.]+',2,'-v','Pidgin',0,1,0], + 'quassel' => ['',1,'-v','Quassel [M]',0,0,0], # special + 'quasselclient' => ['',1,'-v','Quassel',0,0,0],# special + 'quasselcore' => ['',1,'-v','Quassel (core)',0,0,0],# special + 'gribble' => ['^Supybot',2,'--version','Gribble',1,0,0],# special + 'limnoria' => ['^Supybot',2,'--version','Limnoria',1,0,0],# special + 'supybot' => ['^Supybot',2,'--version','Supybot',1,0,0],# special + 'weechat' => ['[0-9.]+',1,'-v','WeeChat',1,0,0], + 'weechat-curses' => ['[0-9.]+',1,'-v','WeeChat',1,0,0], + 'xchat-gnome' => ['[0-9.]+',2,'-v','X-Chat-Gnome',1,1,0], + 'xchat' => ['[0-9.]+',2,'-v','X-Chat',1,1,0], ## Desktops - 'afterstep' => ['^afterstep',3,'--version','AfterStep',0,1], - 'awesome' => ['^awesome',2,'--version','Awesome',0,1], - 'blackbox' => ['^Blackbox',2,'--version','Blackbox',0,1], - 'budgie' => ['^budgie-desktop',2,'--version','Budgie',0,1], - 'cinnamon' => ['^cinnamon',2,'--version','Cinnamon',0,1], - 'dwm' => ['^dwm',1,'-v','dwm',0,1], - 'fluxbox' => ['^fluxbox',2,'--version','Fluxbox',0,1], - 'fvwm' => ['^fvwm',2,'--version','FVWM',0,0], + 'afterstep' => ['^afterstep',3,'--version','AfterStep',0,1,0], + 'awesome' => ['^awesome',2,'--version','Awesome',0,1,0], + 'blackbox' => ['^Blackbox',2,'--version','Blackbox',0,1,0], + 'budgie' => ['^budgie-desktop',2,'--version','Budgie',0,1,0], + 'cinnamon' => ['^cinnamon',2,'--version','Cinnamon',0,1,0], + 'dwm' => ['^dwm',1,'-v','dwm',0,1,1], + 'fluxbox' => ['^fluxbox',2,'--version','Fluxbox',0,1,0], + 'fvwm' => ['^fvwm',2,'--version','FVWM',0,0,1], # command: fvwm - 'fvwm-crystal' => ['^fvwm',2,'--version','FVWM-Crystal',0,0], - 'gnome-about' => ['gnome',3,'--version','Gnome',0,1], - 'gnome-shell' => ['gnome',3,'--version','Gnome',0,1], - 'herbstluftwm' => ['^herbstluftwm',-1,'--version','herbstluftwm',0,1], - 'jwm' => ['^jwm',2,'--version','JWM',0,1], + 'fvwm-crystal' => ['^fvwm',2,'--version','FVWM-Crystal',0,0,0], + 'gnome-about' => ['gnome',3,'--version','Gnome',0,1,0], + 'gnome-shell' => ['gnome',3,'--version','Gnome',0,1,0], + 'herbstluftwm' => ['^herbstluftwm',-1,'--version','herbstluftwm',0,1,0], + 'jwm' => ['^jwm',2,'--version','JWM',0,1,0], # i3 version 4.13 (2016-11-08) © 2009 Michael Stapelberg and contributors - 'i3' => ['^i3',3,'--version','i3',0,1], - 'icewm' => ['^icewm',2,'--version','IceWM',0,1], - 'kded' => ['^KDE Development Platform:',4,'--version','KDE',0,1], - 'kded1' => ['^KDE Development Platform:',4,'--version','KDE',0,1], - 'kded2' => ['^KDE Development Platform:',4,'--version','KDE',0,1], - 'kded3' => ['^KDE Development Platform:',4,'--version','KDE',0,1], - 'kded4' => ['^KDE Development Platform:',4,'--version','KDE',0,1], + 'i3' => ['^i3',3,'--version','i3',0,1,0], + 'icewm' => ['^icewm',2,'--version','IceWM',0,1,0], + 'kded' => ['^KDE Development Platform:',4,'--version','KDE',0,1,0], + 'kded1' => ['^KDE Development Platform:',4,'--version','KDE',0,1,0], + 'kded2' => ['^KDE Development Platform:',4,'--version','KDE',0,1,0], + 'kded3' => ['^KDE Development Platform:',4,'--version','KDE',0,1,0], + 'kded4' => ['^KDE Development Platform:',4,'--version','KDE',0,1,0], # command: lxqt-about - 'lxqt' => ['^lxqt-about',2,'--version','LXQT',0,1], - 'mate-about' => ['^MATE[[:space:]]DESKTOP',-1,'--version','MATE',0,1], - 'mate-session' => ['^mate-session',-1,'--version','MATE',0,1], - 'openbox' => ['^openboxt',2,'--version','Openbox',0,1], - 'pekwm' => ['^pekwm',3,'--version','pekwm',0,1], - 'plasmashell' => ['^plasmashell',2,'--version','KDE Plasma',0,1], - 'qtdiag' => ['^qt',2,'--version','Qt',0,1], - 'sawfish' => ['^sawfish',3,'--version','Sawfish',0,1], - 'scrotwm' => ['^welcome.*scrotwm',4,'-v','Scrotwm',0,1], - 'spectrwm' => ['^spectrwm.*welcome.*spectrwm',5,'-v','Spectrwm',0,1], - 'unity' => ['^unity',2,'--version','Unity',0,1], - 'wm2' => ['^wm2',-1,'--version','WM2',0,1], - 'wmaker' => ['^Window[[:space:]]*Maker',-1,'--version','WindowMaker',0,1], - 'wmii' => ['^wmii',1,'--version','wmii',0,1], # note: in debian, wmii is wmii3 - 'wmii2' => ['^wmii2',1,'--version','wmii2',0,1], - 'xfce4-panel' => ['^xfce4-panel',2,'--version','Xfce',0,1], - 'xfce5-panel' => ['^xfce5-panel',2,'--version','Xfce',0,1], - 'xfdesktop' => ['xfdesktop[[:space:]]version',5,'--version','Xfce',0,1], + 'lxqt' => ['^lxqt-about',2,'--version','LXQT',0,1,0], + 'mate-about' => ['^MATE[[:space:]]DESKTOP',-1,'--version','MATE',0,1,0], + # note, mate-session when launched with full path returns full path in version string + 'mate-session' => ['mate-session',-1,'--version','MATE',0,1,0], + 'openbox' => ['^openboxt',2,'--version','Openbox',0,1,0], + 'pekwm' => ['^pekwm',3,'--version','pekwm',0,1,0], + 'plasmashell' => ['^plasmashell',2,'--version','KDE Plasma',0,1,0], + 'qtdiag' => ['^qt',2,'--version','Qt',0,1,0], + 'sawfish' => ['^sawfish',3,'--version','Sawfish',0,1,0], + 'scrotwm' => ['^welcome.*scrotwm',4,'-v','Scrotwm',0,1,1], + 'spectrwm' => ['^spectrwm.*welcome.*spectrwm',5,'-v','Spectrwm',0,1,0], + 'unity' => ['^unity',2,'--version','Unity',0,1,0], + 'wm2' => ['^wm2',-1,'--version','WM2',0,1,0], + 'wmaker' => ['^Window[[:space:]]*Maker',-1,'--version','WindowMaker',0,1,0], + 'wmii' => ['^wmii',1,'--version','wmii',0,1,0], # note: in debian, wmii is wmii3 + 'wmii2' => ['^wmii2',1,'--version','wmii2',0,1,0], + 'xfce4-panel' => ['^xfce4-panel',2,'--version','Xfce',0,1,0], + 'xfce5-panel' => ['^xfce5-panel',2,'--version','Xfce',0,1,0], + 'xfdesktop' => ['xfdesktop[[:space:]]version',5,'--version','Xfce',0,1,0], # command: xfdesktop - 'xfdesktop-toolkit' => ['Built[[:space:]]with[[:space:]]GTK',4,'--version','Gtk',0,1], + 'xfdesktop-toolkit' => ['Built[[:space:]]with[[:space:]]GTK',4,'--version','Gtk',0,1,0], ## Shells - 'bash' => ['^GNU[[:space:]]bash,[[:space:]]version',4,'--version','Bash',1,0], - 'csh' => ['^tcsh',2,'--version','csh',1,0], - 'dash' => ['dash',3,'--version','Dash',1,0], # no version, uses dpkg query, sigh + 'bash' => ['^GNU[[:space:]]bash,[[:space:]]version',4,'--version','Bash',1,0,0], + 'csh' => ['^tcsh',2,'--version','csh',1,0,0], + 'dash' => ['dash',3,'--version','Dash',1,0,0], # no version, uses dpkg query, sigh # ksh/lksh/mksh/pdksh can't be handled with version but we'll use the search string to # trigger version return and tests - 'ksh' => ['ksh',5,'-v','ksh',1,0], - 'lksh' => ['ksh',5,'-v','lksh',1,0], - 'loksh' => ['ksh',5,'-v','lksh',1,0], - 'mksh' => ['ksh',5,'-v','mksh',1,0], - 'pdksh' => ['ksh',5,'-v','pdksh',1,0], - 'tcsh' => ['^tcsh',2,'--version','tcsh',1,0], - 'zsh' => ['^zsh',2,'--version','zsh',1,0], + 'ksh' => ['ksh',5,'-v','ksh',1,0,0], + 'lksh' => ['ksh',5,'-v','lksh',1,0,0], + 'loksh' => ['ksh',5,'-v','lksh',1,0,0], + 'mksh' => ['ksh',5,'-v','mksh',1,0,0], + 'pdksh' => ['ksh',5,'-v','pdksh',1,0,0], + 'tcsh' => ['^tcsh',2,'--version','tcsh',1,0,0], + 'zsh' => ['^zsh',2,'--version','zsh',1,0,0], ## Tools - 'clang' => ['clang',3,'--version','Clang',1,0], - 'gcc' => ['^gcc',3,'--version','GCC',1,0], - 'gcc-apple' => ['Apple[[:space:]]LLVM',2,'--version','LLVM',1,0], - 'sudo' => ['^Sudo',3,'--version','Sudo',1,0], + 'clang' => ['clang',3,'--version','Clang',1,0,0], + 'gcc' => ['^gcc',3,'--version','GCC',1,0,0], + 'gcc-apple' => ['Apple[[:space:]]LLVM',2,'--version','LLVM',1,0,0], + 'sudo' => ['^Sudo',3,'--version','Sudo',1,0,0], ); if ( defined $data{$app} ){ my $ref = $data{$app}; @@ -2976,19 +2986,17 @@ sub program_values { } # args: 1 - desktop/app command for --version; 2 - search string; # 3 - space print number; 4 - [optional] version arg: -v, version, etc +# 5 - [optional] exit first find 0/1; 6 - [optional] 0/1 stderr output sub program_version { eval $start if $b_log; - my ($app, $search, $num,$version,$exit) = @_; + my ($app, $search, $num,$version,$exit,$b_stderr) = @_; my ($cmd,$line,$output); my $version_nu = ''; my $count = 0; - $exit ||= 100; # basically don't exit ever $version ||= '--version'; - # adjust to array index, not human readable $num-- if (defined $num && $num > 0); - # ksh: Version JM 93t+ 2010--03-05 # mksh: @(#)MIRBSD KSH R56 2018/03/09 # loksh: @(#)PD KSH v5.2.14 99/07/13.2 @@ -3017,7 +3025,7 @@ sub program_version { } } # note, some wm/apps send version info to stderr instead of stdout - if ( $app =~ /\/(dwm|fvwm|kvirc|scrotwm)$/ ) { + if ( $b_stderr ) { $cmd = "$app $version 2>&1"; } # elsif ( $app eq 'csh' ){ @@ -3637,7 +3645,7 @@ sub get_options{ $b_arm = 1 }, 'bsd:s' => sub { my ($opt,$arg) = @_; - if ($arg =~ /^dragonfly|freebsd|openbsd|netbsd$/i){ + if ($arg =~ /^(darwin|dragonfly|freebsd|openbsd|netbsd)$/i){ $bsd_type = lc($arg); } else { @@ -4008,6 +4016,7 @@ sub show_options { ['2', '-R', '', "md-raid: second RAID Info line with extra data: blocks, chunk size, bitmap (if present). Resync line, shows blocks synced/total blocks." ], + ['2', '-s', '', "Basic voltages (ipmi only): 12v, 5v, 3.3v, vbat." ], ['2', '-S', '', "Desktop toolkit, if available (GNOME/Xfce/KDE only); Kernel gcc version" ], ['2', '-t', '', "Adds memory use output to CPU (-xt c), and CPU use to @@ -4024,7 +4033,7 @@ sub show_options { ['1', '-xx', '--extra 2', "Show extra, extra data (only works with verbose or line output, not short form):" ], ['2', '-A', '', "Chip vendor:product ID for each audio device." ], - ['2', '-B', '', "Serial number, voltage (if available)." ], + ['2', '-B', '', "Serial number, voltage now/minimum (if available)." ], ['2', '-C', '', "Minimum CPU speed, if available." ], ['2', '-D', '', "Disk serial number." ], ['2', '-G', '', "Chip vendor:product ID for each video card; OpenGL @@ -4037,6 +4046,7 @@ sub show_options { ['2', '-N', '', "Chip vendor:product ID for each NIC." ], ['2', '-R', '', "md-raid: Superblock (if present), algorithm. If resync, shows progress bar." ], + ['2', '-s', '', "DIMM/SOC voltages (ipmi only)." ], ['2', '-S', '', "Display manager (dm) in desktop output if in X (e.g. kdm, gdm3, lightdm)." ], ['2', '--slots', '', "Slot length." ], @@ -4331,7 +4341,7 @@ sub get_client_version { my (@data,@working,$string); if (@app){ $string = ($client{'name'} =~ /^gribble|limnoria|supybot$/) ? 'supybot' : $client{'name'}; - $client{'version'} = main::program_version($string,$app[0],$app[1],$app[2]); + $client{'version'} = main::program_version($string,$app[0],$app[1],$app[2],$app[4],$app[5],$app[6]); $client{'name-print'} = $app[3]; $client{'console-irc'} = $app[4]; } @@ -4395,7 +4405,7 @@ sub get_client_version { # (KSirc sucks anyway ;) foreach (@cmdline){ if ( $_ =~ /dsirc/ ){ - $client{'version'} = main::program_version('ksirc','KSirc:',2,'-v',0); + $client{'version'} = main::program_version('ksirc','KSirc:',2,'-v',0,0); $client{'name'} = 'ksirc'; $client{'name-print'} = 'KSirc'; } @@ -4446,7 +4456,7 @@ sub perl_python_client { # main::print_line("konvi: " . scalar grep { $_ =~ /konversation/ } @ps_cmd); if ( $b_display && main::check_program('konversation') && ( scalar grep { $_ =~ /konversation/ } @ps_cmd ) > 0){ @app = main::program_values('konversation'); - $client{'version'} = main::program_version('konversation',$app[0],$app[1],$app[2]); + $client{'version'} = main::program_version('konversation',$app[0],$app[1],$app[2],$app[5],$app[6]); $client{'name'} = 'konversation'; $client{'name-print'} = $app[3]; $client{'console-irc'} = $app[4]; @@ -4457,7 +4467,7 @@ sub perl_python_client { (main::check_program('supybot') || main::check_program('gribble') || main::check_program('limnoria')) && ( scalar grep { $_ =~ /supybot/ } @ps_cmd ) > 0 ){ @app = main::program_values('supybot'); - $client{'version'} = main::program_version('supybot',$app[0],$app[1],$app[2]); + $client{'version'} = main::program_version('supybot',$app[0],$app[1],$app[2],$app[5],$app[6]); if ($client{'version'}){ if ( ( scalar grep { $_ =~ /gribble/ } @ps_cmd ) > 0){ $client{'name'} = 'gribble'; @@ -4509,7 +4519,7 @@ sub check_modern_konvi { @app = main::program_values('konversation'); if ($konvi){ @app = main::program_values('konversation'); - $konvi_version = main::program_version($konvi,$app[0],$app[1],$app[2]); + $konvi_version = main::program_version($konvi,$app[0],$app[1],$app[2],$app[5],$app[6]); @temp = split /\./, $konvi_version; $client{'console-irc'} = $app[4]; $client{'konvi'} = 3; @@ -4743,6 +4753,7 @@ sub row_defaults { 'battery-data' => "No battery data found. Is one present?", 'battery-data-sys' => "No /sys data found. Old system?", 'cpu-model-null' => "Model N/A", + 'darwin-feature' => "Feature not supported iu Darwin/OSX.", 'disk-data-bsd' => "No disk data found for this BSD system.", 'disk-data' => "No Disk data was found.", 'disk-size-0' => "Total N/A", @@ -5600,7 +5611,7 @@ sub create_output { $volts = "$battery{$key}{'voltage_now'}/$battery{$key}{'voltage_min_design'}"; } $volts ||= 'N/A'; - $rows[$j]{main::key($num++,'volts now/min')} = $volts; + $rows[$j]{main::key($num++,'volts')} = $volts; } if ($battery{$key}{'manufacturer'} || $battery{$key}{'model_name'}) { if ($battery{$key}{'manufacturer'} && $battery{$key}{'model_name'}){ @@ -5844,7 +5855,6 @@ sub create_output_full { my $ref = $cpu{'processors'}; my @processors = @$ref; my @speeds = cpu_speeds(@processors); - my $j = scalar @rows; $cpu{'model_name'} ||= 'N/A'; @data = ({ @@ -5852,14 +5862,17 @@ sub create_output_full { main::key($num++,'model') => $cpu{'model_name'}, },); @rows = (@rows,@data); + #if ($extra > 1){ + $properties{'bits-sys'} ||= 'N/A'; + $rows[$j]{main::key($num++,'bits')} = $properties{'bits-sys'}; + #} if ($type){ $rows[$j]{main::key($num++,'type')} = $type; } if ($extra > 0){ - my $arch = $cpu{'arch'}; - $arch ||= 'N/A'; - $rows[$j]{main::key($num++,'arch')} = $arch; - if ( $arch ne 'N/A' && $cpu{'rev'} ){ + $cpu{'arch'} ||= 'N/A'; + $rows[$j]{main::key($num++,'arch')} = $cpu{'arch'}; + if ( $cpu{'arch'} ne 'N/A' && $cpu{'rev'} ){ $rows[$j]{main::key($num++,'rev')} = $cpu{'rev'}; } } @@ -6618,7 +6631,11 @@ sub cpu_properties { $speed = "$cpu{'cur-freq'} MHz"; } + if ( !$bits_sys && !$b_arm && $cpu{'flags'} ){ + $bits_sys = ($cpu{'flags'} =~ /\blm\b/) ? 64 : 32; + } my %cpu_properties = ( + 'bits-sys' => $bits_sys, 'cpu-layout' => $cpu_layout, 'cpu-type' => $cpu_type, 'min-max-key' => $min_max_key, @@ -6738,14 +6755,13 @@ sub cpu_flags_bsd { my ($flags,$sep) = ('',''); # this will be null if it was not readable my $file = main::system_files('dmesg-boot'); - if ( $file && ! -r $file ){ $flags = main::row_defaults('dmesg-boot-permissions'); } else { foreach (@dmesg_boot){ - if ( /Features/ || ( $bsd_type eq "openbsd" && /^cpu0.*\s[a-z][a-z][a-z](\s|,)[a-z][a-z][a-z](\s|,)/ ) ) { - my @line = split /:/, $_; + if ( /Features/ || ( $bsd_type eq "openbsd" && /^cpu0:\s*[a-z0-9]{2,3}(\s|,)[a-z0-9]{2,3}(\s|,)/i ) ) { + my @line = split /:\s*/, lc($_); # free bsd has to have weird syntax: <....,> # Features2=0x1e98220b $line[1] =~ s/^[^<]*<|>[^>]*$//g; @@ -6753,7 +6769,8 @@ sub cpu_flags_bsd { $line[1] =~ s/<[^>]+>//g; # and replace commas with spaces $line[1] =~ s/,/ /g; - $flags .= ' ' . $line[1]; + $flags .= $sep . $line[1]; + $sep = ' '; } elsif (/real mem/){ last; @@ -8326,8 +8343,7 @@ sub create_output { # foreach my $key (keys %data){ # print "$key: $data{$key}\n"; # } - if (!$data{'sys_vendor'} || - ($data{'sys_vendor'} && $data{'board_vendor'} && + if (!$data{'sys_vendor'} || ($data{'board_vendor'} && $data{'sys_vendor'} eq $data{'board_vendor'} && !$data{'product_name'} && !$data{'product_version'} && !$data{'product_serial'})){ $b_skip_system = 1; @@ -9679,9 +9695,11 @@ sub get { eval $start if $b_log; my (@rows,$key1,$val1); my $num = 0; - partition_data() if !$b_partitions;; + partition_data() if !$b_partitions; if (!@partitions) { $key1 = 'Message'; + #$val1 = ($bsd_type && $bsd_type eq 'darwin') ? + # main::row_defaults('darwin-feature') : main::row_defaults('partition-data'); $val1 = main::row_defaults('partition-data'); @rows = ({main::key($num++,$key1) => $val1,}); } @@ -9763,8 +9781,10 @@ sub create_output { sub partition_data { eval $start if $b_log; + #return if $bsd_type && $bsd_type eq 'darwin'; # darwin has muated output, of course my (@data,@rows,@mapper,@mount,@partitions_working); - my ($b_fs,$b_load,$cols,$roots) = (1,0,6,0); + my ($b_fake_map,$b_fs,$b_load,$cols,$roots) = (0,1,0,6,0); + my ($back_size,$back_used) = (4,3); my ($dev_base,$fs,$id,$label,$percent_used,$size,$type,$uuid,$used); $b_partitions = 1; set_lsblk() if !$bsd_type && !$b_lsblk; @@ -9779,12 +9799,20 @@ sub partition_data { } } else { - @partitions_working = main::grabber("df -T -k 2>/dev/null"); # this is missing the file system data + if ($bsd_type ne 'darwin'){ + $cols = 5; + @partitions_working = main::grabber("df -T -k 2>/dev/null"); + } + #Filesystem 1024-blocks Used Available Capacity iused ifree %iused Mounted on + else { + $cols = 8; + $b_fake_map = 1; + ($back_size,$back_used) = (7,6); + } if (!@partitions_working){ @partitions_working = main::grabber("df -k 2>/dev/null"); $b_fs = 0; - $cols = 5; if (my $path = main::check_program('mount')){ @mount = main::grabber("$path 2>/dev/null"); } @@ -9805,6 +9833,8 @@ sub partition_data { $filters .= 'fdescfs|iso9660|linprocfs|none|procfs|\/run(\/.*)?|run|squashfs|sys|\/sys\/.*|sysfs|'; $filters .= 'tmpfs|type|udev|unionfs|vartmp)$'; foreach (@partitions_working){ + # stupid apple bullshit + $_ =~ s/^map\s+([\S]+)/map:\/$1/ if $b_fake_map; my @row = split /\s+/, $_; if ($row[0] =~ /$filters/ || $row[0] =~ /^ROOT/i){ next; @@ -9870,8 +9900,8 @@ sub partition_data { $fs = ($b_fs) ? $row[1]: get_bsd_fs($row[0],@mount); $id = join ' ', @row[$cols .. $#row]; $id =~ s/\/home\/[^\/]+\/(.*)/\/home\/$filter_string\/$1/ if $show{'filter'}; - $size = $row[$cols - 4]; - $used = $row[$cols - 3]; + $size = $row[$cols - $back_size]; + $used = $row[$cols - $back_used]; $percent_used = sprintf( "%.1f", ( $used/$size )*100 ) if ($size); @data = ({ 'id' => $id, @@ -9960,6 +9990,7 @@ sub swap_data { sub get_bsd_fs { eval $start if $b_log; my ($item,@mount) = @_; + $item =~ s/map:\/(\S+)/map $1/ if $bsd_type eq 'darwin'; return 'N/A' if ! @mount; my ($fs) = (''); # linux: /dev/sdb6 on /var/www/m type ext4 (rw,relatime,data=ordered) @@ -12196,6 +12227,26 @@ sub create_output { } } } + if ($extra > 0 && $source eq 'ipmi'){ + $j = scalar @rows; + $sensors{'volts-12'} ||= 'N/A'; + $sensors{'volts-5'} ||= 'N/A'; + $sensors{'volts-3.3'} ||= 'N/A'; + $sensors{'volts-dimm-p1'} ||= 'N/A'; + $sensors{'volts-dimm-p2'} ||= 'N/A'; + $sensors{'volts-vbat'} ||= 'N/A'; + $rows[$j]{main::key($num++,'Voltages')} = $data_source; + $rows[$j]{main::key($num++,'12v')} = $sensors{'volts-12'}; + $rows[$j]{main::key($num++,'5v')} = $sensors{'volts-5'}; + $rows[$j]{main::key($num++,'3.3v')} = $sensors{'volts-3.3'}; + $rows[$j]{main::key($num++,'vbat')} = $sensors{'volts-vbat'}; + if ($extra > 1){ + $rows[$j]{main::key($num++,'dimm-p1')} = $sensors{'volts-dimm-p1'} if $sensors{'volts-dimm-p1'}; + $rows[$j]{main::key($num++,'dimm-p2')} = $sensors{'volts-dimm-p2'} if $sensors{'volts-dimm-p2'}; + $rows[$j]{main::key($num++,'soc-p1')} = $sensors{'volts-soc-p1'} if $sensors{'volts-soc-p1'}; + $rows[$j]{main::key($num++,'soc-p2')} = $sensors{'volts-soc-p2'} if $sensors{'volts-soc-p2'}; + } + } eval $end if $b_log; return @rows; } @@ -12299,6 +12350,33 @@ sub ipmi_data { } } } + if ($extra > 0){ + if ($row[$i_key] =~ /^12V$/i) { + $sensors{'volts-12'} = $row[$i_value]; + } + elsif ($row[$i_key] =~ /^(P5V|5VCC)$/i) { + $sensors{'volts-5'} = $row[$i_value]; + } + elsif ($row[$i_key] =~ /^(P3V3|3.3VCC)$/i) { + $sensors{'volts-3.3'} = $row[$i_value]; + } + elsif ($row[$i_key] =~ /^VBAT$/i) { + $sensors{'volts-vbat'} = $row[$i_value]; + } + # NOTE: VDimmP1ABC VDimmP1DEF + elsif (!$sensors{'volts-dimm-p1'} && $row[$i_key] =~ /^(P1_VMEM|VDimmP1)/i) { + $sensors{'volts-dimm-p1'} = $row[$i_value]; + } + elsif (! $sensors{'volts-dimm-p2'} && $row[$i_key] =~ /^(P2_VMEM|VDimmP2)/i) { + $sensors{'volts-dimm-p2'} = $row[$i_value]; + } + elsif (!$sensors{'volts-soc-p1'} && $row[$i_key] =~ /^(P1_SOC_RUN$)/i) { + $sensors{'volts-soc-p1'} = $row[$i_value]; + } + elsif (! $sensors{'volts-soc-p2'} && $row[$i_key] =~ /^(P2_SOC_RUN$)/i) { + $sensors{'volts-soc-p2'} = $row[$i_value]; + } + } } # print Data::Dumper::Dumper \%sensors; @@ -12706,22 +12784,23 @@ sub data_processor { %sensors = (); } else { - my ($psu_temp,$sodimm_temp); - if ( $sensors{'psu-temp'} ){ - $psu_temp = $sensors{'psu-temp'}; - } + my ($psu_temp,$sodimm_temp,$v_12,$v_5,$v_3_3,$v_dimm_p1,$v_dimm_p2,$v_soc_p1,$v_soc_p2,$v_vbat); + $psu_temp = $sensors{'psu-temp'} if $sensors{'psu-temp'}; # sodimm fan is fan_main[4] - if ( $sensors{'sodimm-temp'} ){ - $sodimm_temp = $sensors{'sodimm-temp'}; - } - if ( $sensors{'cpu2-temp'} ){ - $cpu2_temp = $sensors{'cpu2-temp'}; - } - if ( $sensors{'cpu3-temp'} ){ - $cpu3_temp = $sensors{'cpu3-temp'}; - } - if ( $sensors{'cpu4-temp'} ){ - $cpu4_temp = $sensors{'cpu4-temp'}; + $sodimm_temp = $sensors{'sodimm-temp'} if $sensors{'sodimm-temp'}; + $cpu2_temp = $sensors{'cpu2-temp'} if $sensors{'cpu2-temp'}; + $cpu3_temp = $sensors{'cpu3-temp'} if $sensors{'cpu3-temp'}; + $cpu4_temp = $sensors{'cpu4-temp'} if $sensors{'cpu4-temp'}; + # so far only for ipmi, sensors data is junk for volts + if ($extra > 0 && $sensors{'volts-12'} ){ + $v_12 = $sensors{'volts-12'} if $sensors{'volts-12'}; + $v_5 = $sensors{'volts-5'} if $sensors{'volts-5'}; + $v_3_3 = $sensors{'volts-3.3'} if $sensors{'volts-3.3'}; + $v_vbat = $sensors{'volts-vbat'} if $sensors{'volts-vbat'}; + $v_dimm_p1 = $sensors{'volts-dimm-p1'} if $sensors{'volts-dimm-p1'}; + $v_dimm_p2 = $sensors{'volts-dimm-p2'} if $sensors{'volts-dimm-p2'}; + $v_soc_p1 = $sensors{'volts-soc-p1'} if $sensors{'volts-soc-p1'}; + $v_soc_p2 = $sensors{'volts-soc-p2'} if $sensors{'volts-soc-p2'}; } %sensors = ( 'cpu-temp' => $cpu_temp, @@ -12740,6 +12819,16 @@ sub data_processor { if ($sodimm_temp){ $sensors{'sodimm-temp'} = $sodimm_temp; } + if ($extra > 0 && ($v_12 || $v_5 || $v_3_3) ){ + $sensors{'volts-12'} = $v_12; + $sensors{'volts-5'} = $v_5; + $sensors{'volts-3.3'} = $v_3_3; + $sensors{'volts-vbat'} = $v_vbat; + $sensors{'volts-dimm-p1'} = $v_dimm_p1; + $sensors{'volts-dimm-p2'} = $v_dimm_p2; + $sensors{'volts-soc-p1'} = $v_soc_p1; + $sensors{'volts-soc-p2'} = $v_soc_p2; + } } eval $end if $b_log; return %sensors; @@ -13200,7 +13289,7 @@ sub usb_data { @row = split /:/, $line; next if ! defined $row[0]; if ($row[0] eq 'bcdUSB' && defined $row[1]){ - $speed = sprintf("%1.1f",$row[1]); + $speed = ($row[1] =~ /^[0-9,\.]+$/) ? sprintf("%1.1f",$row[1]) : $row[1]; } elsif ($row[0] eq '~bInterfaceProtocol' && $row[2] ){ $protocol = $row[2]; @@ -13722,7 +13811,7 @@ sub get_kde_data { @data = main::program_values("kded$kde_session_version"); if (@data){ $desktop[0] = $data[3]; - $desktop[1] = main::program_version("kded$kde_session_version",$data[0],$data[1],$data[2],$data[5]); + $desktop[1] = main::program_version("kded$kde_session_version",$data[0],$data[1],$data[2],$data[5],$data[6]); # kded exists, so we can now get the qt data string as well if ($desktop[1] && ($program = main::check_program("kded$kde_session_version")) ){ @version_data = main::grabber("$program --version 2>/dev/null"); @@ -13782,20 +13871,20 @@ sub get_env_de_data { @data = main::program_values('unity'); $desktop[0] = $data[3]; $desktop[0] ||= 'Unity'; - $desktop[1] = main::program_version('cinnamon',$data[0],$data[1],$data[2],$data[5]); + $desktop[1] = main::program_version('cinnamon',$data[0],$data[1],$data[2],$data[5],$data[6]); set_gtk_data() if $extra > 0; } elsif ( $xdg_desktop =~ /budgie/ ){ @data = main::program_values('budgie'); $desktop[0] = $data[3]; - $desktop[1] = main::program_version('budgie-desktop',$data[0],$data[1],$data[2],$data[5]); + $desktop[1] = main::program_version('budgie-desktop',$data[0],$data[1],$data[2],$data[5],$data[6]); set_gtk_data() if $extra > 0; } elsif ( $xdg_desktop eq 'lxqt' ){ @data = main::program_values('lxqt'); $desktop[0] = $data[3]; $desktop[0] ||= 'LXQT'; - $desktop[1] = main::program_version('lxqt-about',$data[0],$data[1],$data[2],$data[5]); + $desktop[1] = main::program_version('lxqt-about',$data[0],$data[1],$data[2],$data[5],$data[6]); if ( $extra > 0 ){ if ($program = main::check_program("kded$kde_session_version") ){ @version_data = main::grabber("$program --version 2>/dev/null"); @@ -13804,7 +13893,7 @@ sub get_env_de_data { } elsif ($program = main::check_program("qtdiag") ){ @data = main::program_values('qtdiag'); - $desktop[3] = main::program_version($program,$data[0],$data[1],$data[2],$data[5]); + $desktop[3] = main::program_version($program,$data[0],$data[1],$data[2],$data[5],$data[6]); $desktop[2] = $data[3]; } } @@ -13814,7 +13903,7 @@ sub get_env_de_data { elsif ( $xdg_desktop =~ /cinnamon/ ){ @data = main::program_values('cinnamon'); $desktop[0] = $data[3]; - $desktop[1] = main::program_version('cinnamon',$data[0],$data[1],$data[2],$data[5]); + $desktop[1] = main::program_version('cinnamon',$data[0],$data[1],$data[2],$data[5],$data[6]); set_gtk_data() if $extra > 0; } eval $end if $b_log; @@ -13833,22 +13922,22 @@ sub get_env_xprop_de_data { ($b_xprop && main::awk(\@xprop,'_muffin') )){ @data = main::program_values('cinnamon'); $desktop[0] = $data[3]; - $desktop[1] = main::program_version('cinnamon',$data[0],$data[1],$data[2],$data[5]); + $desktop[1] = main::program_version('cinnamon',$data[0],$data[1],$data[2],$data[5],$data[6]); set_gtk_data() if $extra > 0; $desktop[0] ||= 'Cinnamon'; } elsif ($xdg_desktop eq 'mate' || ( $b_xprop && main::awk(\@xprop,'_marco') )){ # NOTE: mate-about reported wrong version, 1.18.0 when actual was 1.18.2 -# if ($program = main::check_program('mate-session') ) { -# $value = 'mate-session'; -# } -# if (!$program && ($program = main::check_program('mate-about') ) ) { + if ($program = main::check_program('mate-session') ) { + $value = 'mate-session'; + } + elsif ($program = main::check_program('mate-about')) { $value = 'mate-about'; -# } + } if ($value){ @data = main::program_values($value); $desktop[0] = $data[3]; - $desktop[1] = main::program_version($value,$data[0],$data[1],$data[2],$data[5]); + $desktop[1] = main::program_version($program,$data[0],$data[1],$data[2],$data[5],$data[6]); } set_gtk_data() if $extra > 0; $desktop[0] ||= 'MATE'; @@ -13860,11 +13949,11 @@ sub get_env_xprop_de_data { (main::check_program('gnome-shell') && $b_xprop && main::awk(\@xprop,'^_gnome') ) ){ if ($program = main::check_program('gnome-about') ) { @data = main::program_values('gnome-about'); - $desktop[1] = main::program_version('gnome-about',$data[0],$data[1],$data[2],$data[5]); + $desktop[1] = main::program_version('gnome-about',$data[0],$data[1],$data[2],$data[5],$data[6]); } elsif ($program = main::check_program('gnome-shell') ) { @data = main::program_values('gnome-shell'); - $desktop[1] = main::program_version('gnome-shell',$data[0],$data[1],$data[2],$data[5]); + $desktop[1] = main::program_version('gnome-shell',$data[0],$data[1],$data[2],$data[5],$data[6]); } set_gtk_data() if $extra > 0; $desktop[0] = ( $data[3] ) ? $data[3] : 'Gnome'; @@ -13895,13 +13984,13 @@ sub get_xprop_de_data { @version_data = main::grabber('xfdesktop --version 2>/dev/null'); # out of x, this error goes to stderr, so it's an empty result $desktop[1] = main::awk(\@version_data,$data[0],$data[1],'\s+'); - #$desktop[1] = main::program_version('xfdesktop',$data[0],$data[1],$data[2],$data[5]); + #$desktop[1] = main::program_version('xfdesktop',$data[0],$data[1],$data[2],$data[5],$data[6]); if ( !$desktop[1] ){ @data = main::program_values("xfce${version}-panel"); # print Data::Dumper::Dumper \@data; # this returns an error message to stdout in x, which breaks the version # xfce4-panel --version out of x fails to get display, so no data - $desktop[1] = main::program_version("xfce${version}-panel",$data[0],$data[1],$data[2],$data[5]); + $desktop[1] = main::program_version("xfce${version}-panel",$data[0],$data[1],$data[2],$data[5],$data[6]); # out of x this kicks out an error: xfce4-panel: Cannot open display $desktop[1] = '' if $desktop[1] !~ /[0-9]\./; } @@ -13909,7 +13998,7 @@ sub get_xprop_de_data { $desktop[1] ||= 4; if ($extra > 0){ @data = main::program_values('xfdesktop-toolkit'); - #$desktop[3] = main::program_version('xfdesktop',$data[0],$data[1],$data[2],$data[5]); + #$desktop[3] = main::program_version('xfdesktop',$data[0],$data[1],$data[2],$data[5],$data[6]); $desktop[3] = main::awk(\@version_data,$data[0],$data[1],'\s+'); $desktop[2] = $data[3]; } @@ -13918,12 +14007,12 @@ sub get_xprop_de_data { if (grep {/fluxbox/} @ps_cmd){ @data = main::program_values('fluxbox'); $desktop[0] = $data[3]; - $desktop[1] = main::program_version('fluxbox',$data[0],$data[1],$data[2],$data[5]); + $desktop[1] = main::program_version('fluxbox',$data[0],$data[1],$data[2],$data[5],$data[6]); } else { @data = main::program_values('blackbox'); $desktop[0] = $data[3]; - $desktop[1] = main::program_version('blackbox',$data[0],$data[1],$data[2],$data[5]); + $desktop[1] = main::program_version('blackbox',$data[0],$data[1],$data[2],$data[5],$data[6]); } } # debian package: lxde-core @@ -13931,7 +14020,7 @@ sub get_xprop_de_data { main::check_program('razor-session')) && main::awk(\@xprop,'openbox_pid' )){ # note: openbox-lxde --version may be present, but returns openbox data @data = main::program_values('openbox'); - $desktop[1] = main::program_version('openbox',$data[0],$data[1],$data[2],$data[5]); + $desktop[1] = main::program_version('openbox',$data[0],$data[1],$data[2],$data[5],$data[6]); if ($xdg_desktop eq 'lxde' || main::awk(\@ps_cmd, 'lxsession')){ $desktop[1] = "(Openbox $desktop[1])" if $desktop[1]; $desktop[0] = 'LXDE'; @@ -13955,7 +14044,7 @@ sub get_xprop_de_data { elsif (main::check_program('icewm') && main::awk(\@xprop,'icewm' )){ @data = main::program_values('icewm'); $desktop[0] = $data[3]; - $desktop[1] = main::program_version('icewm',$data[0],$data[1],$data[2],$data[5]); + $desktop[1] = main::program_version('icewm',$data[0],$data[1],$data[2],$data[5],$data[6]); } elsif (main::check_program('enlightenment') && main::awk(\@xprop,'enlightenment' )){ $desktop[0] = 'Enlightenment'; @@ -13969,23 +14058,23 @@ sub get_xprop_de_data { elsif (main::check_program('i3') && main::awk(\@xprop,'^i3_' )){ @data = main::program_values('i3'); $desktop[0] = $data[3]; - $desktop[1] = main::program_version('i3',$data[0],$data[1],$data[2],$data[5]); + $desktop[1] = main::program_version('i3',$data[0],$data[1],$data[2],$data[5],$data[6]); } # debian package name: wmaker elsif (main::check_program('WindowMaker') && main::awk(\@xprop,'^windowmaker' )){ @data = main::program_values('wmaker'); $desktop[0] = $data[3]; - $desktop[1] = main::program_version('wmaker',$data[0],$data[1],$data[2],$data[5]); + $desktop[1] = main::program_version('wmaker',$data[0],$data[1],$data[2],$data[5],$data[6]); } elsif (main::check_program('wm2') && main::awk(\@xprop,'^_wm2' )){ @data = main::program_values('wm2'); $desktop[0] = $data[3]; - $desktop[1] = main::program_version('wm2',$data[0],$data[1],$data[2],$data[5]); + $desktop[1] = main::program_version('wm2',$data[0],$data[1],$data[2],$data[5],$data[6]); } elsif (main::check_program('herbstluftwm') && main::awk(\@xprop,'herbstluftwm' )){ @data = main::program_values('herbstluftwm'); $desktop[0] = $data[3]; - $desktop[1] = main::program_version('herbstluftwm',$data[0],$data[1],$data[2],$data[5]); + $desktop[1] = main::program_version('herbstluftwm',$data[0],$data[1],$data[2],$data[5],$data[6]); } # need to check starts line because it's so short eval $end if $b_log; @@ -13996,33 +14085,33 @@ sub get_ps_de_data { if ( main::check_program('fvwm-crystal') && main::awk(\@ps_cmd,'fvwm-crystal' )){ @data = main::program_values('fvwm-crystal'); $desktop[0] = $data[3]; - $desktop[1] = main::program_version('fvwm',$data[0],$data[1],$data[2],$data[5]); + $desktop[1] = main::program_version('fvwm',$data[0],$data[1],$data[2],$data[5],$data[6]); } elsif ((main::check_program('fvwm2') || main::check_program('fvwm')) && main::awk(\@ps_cmd,'fvwm' )){ @data = main::program_values('fvwm'); $desktop[0] = $data[3]; - $desktop[1] = main::program_version('fvwm',$data[0],$data[1],$data[2],$data[5]); + $desktop[1] = main::program_version('fvwm',$data[0],$data[1],$data[2],$data[5],$data[6]); } elsif (main::check_program('pekwm') && main::awk(\@ps_cmd,'pekwm' )){ @data = main::program_values('pekwm'); $desktop[0] = $data[3]; - $desktop[1] = main::program_version('pekwm',$data[0],$data[1],$data[2],$data[5]); + $desktop[1] = main::program_version('pekwm',$data[0],$data[1],$data[2],$data[5],$data[6]); } elsif (main::check_program('awesome') && main::awk(\@ps_cmd,'awesome' )){ @data = main::program_values('awesome'); $desktop[0] = $data[3]; - $desktop[1] = main::program_version('awesome',$data[0],$data[1],$data[2],$data[5]); + $desktop[1] = main::program_version('awesome',$data[0],$data[1],$data[2],$data[5],$data[6]); } # not in debian apt elsif (main::check_program('scrotwm') && main::awk(\@ps_cmd,'scrotwm' )){ @data = main::program_values('scrotwm'); $desktop[0] = $data[3]; - $desktop[1] = main::program_version('scrotwm',$data[0],$data[1],$data[2],$data[5]); + $desktop[1] = main::program_version('scrotwm',$data[0],$data[1],$data[2],$data[5],$data[6]); } elsif (main::check_program('spectrwm') && main::awk(\@ps_cmd,'spectrwm' )){ @data = main::program_values('spectrwm'); $desktop[0] = $data[3]; - $desktop[1] = main::program_version('spectrwm',$data[0],$data[1],$data[2],$data[5]); + $desktop[1] = main::program_version('spectrwm',$data[0],$data[1],$data[2],$data[5],$data[6]); } elsif (main::check_program('twm') && main::awk(\@ps_cmd,'(\s|\/)twm' )){ # no version @@ -14032,33 +14121,33 @@ sub get_ps_de_data { elsif (main::check_program('dwm') && main::awk(\@ps_cmd,'(\s|\/)dwm' )){ @data = main::program_values('dwm'); $desktop[0] = $data[3]; - $desktop[1] = main::program_version('dwm',$data[0],$data[1],$data[2],$data[5]); + $desktop[1] = main::program_version('dwm',$data[0],$data[1],$data[2],$data[5],$data[6]); } # not in debian apt, current is wmii, version 3 elsif (main::check_program('wmii2') && main::awk(\@ps_cmd,'wmii2' )){ @data = main::program_values('wmii2'); $desktop[0] = $data[3]; - $desktop[1] = main::program_version('wmii2',$data[0],$data[1],$data[2],$data[5]); + $desktop[1] = main::program_version('wmii2',$data[0],$data[1],$data[2],$data[5],$data[6]); } elsif (main::check_program('wmii') && main::awk(\@ps_cmd,'wmii' )){ @data = main::program_values('wmii'); $desktop[0] = $data[3]; - $desktop[1] = main::program_version('wmii',$data[0],$data[1],$data[2],$data[5]); + $desktop[1] = main::program_version('wmii',$data[0],$data[1],$data[2],$data[5],$data[6]); } elsif (main::check_program('jwm') && main::awk(\@ps_cmd,'(\s|\/)jwm' )){ @data = main::program_values('jwm'); $desktop[0] = $data[3]; - $desktop[1] = main::program_version('jwm',$data[0],$data[1],$data[2],$data[5]); + $desktop[1] = main::program_version('jwm',$data[0],$data[1],$data[2],$data[5],$data[6]); } elsif (main::check_program('sawfish') && main::awk(\@ps_cmd,'sawfish' )){ @data = main::program_values('sawfish'); $desktop[0] = $data[3]; - $desktop[1] = main::program_version('sawfish',$data[0],$data[1],$data[2],$data[5]); + $desktop[1] = main::program_version('sawfish',$data[0],$data[1],$data[2],$data[5],$data[6]); } elsif ( main::check_program('afterstep') && grep {/afterstep/} @ps_cmd){ @data = main::program_values('afterstep'); $desktop[0] = $data[3]; - $desktop[1] = main::program_version('afterstep',$data[0],$data[1],$data[2],$data[5]); + $desktop[1] = main::program_version('afterstep',$data[0],$data[1],$data[2],$data[5],$data[6]); } eval $end if $b_log; } @@ -14069,6 +14158,11 @@ sub get_wm { my $cmd = "$program -m 2>/dev/null"; my @data = main::grabber($cmd,'','strip'); $desktop[5] = main::awk(\@data,'^Name',2,'\s*:\s*'); + if ($desktop[5]){ + # IceWM 1.3.8 (Linux 3.2.0-4-amd64/i686) + $desktop[5] =~ s/[0-9]+\.[0-9][\S]+|[\[\(].*[\)\]]//g; + $desktop[5] = main::trimmer($desktop[5]); + } } eval $end if $b_log; } @@ -14250,7 +14344,6 @@ sub get_bsd_os { } } else { - my @uname = POSIX::uname(); $distro = "$uname[0] $uname[2]"; } eval $end if $b_log; @@ -14634,7 +14727,6 @@ sub get_kernel_data { my ($kernel,$ksplice) = ('',''); # Linux; yawn; 4.9.0-3.1-liquorix-686-pae; #1 ZEN SMP PREEMPT liquorix 4.9-4 (2017-01-14); i686 # FreeBSD; siwi.pair.com; 8.2-STABLE; FreeBSD 8.2-STABLE #0: Tue May 31 14:36:14 EDT 2016 erik5@iddhi.pair.com:/usr/obj/usr/src/sys/82PAIRx-AMD64; amd64 - my @uname = uname(); if (@uname){ $kernel = $uname[2]; if (check_program('uptrack-uname') && $kernel){ @@ -14642,10 +14734,9 @@ sub get_kernel_data { $ksplice = trimmer($ksplice); $kernel = ($ksplice) ? $ksplice . ' (ksplice)' : $kernel; } - $kernel .= ' ' . $uname[scalar @uname - 1]; + $kernel .= ' ' . $uname[-1]; $kernel = ($bsd_type) ? $uname[0] . ' ' . $kernel : $kernel; } - $kernel ||= 'N/A'; log_data('data',"kernel: $kernel ksplice: $ksplice") if $b_log; eval $end if $b_log; @@ -14654,9 +14745,8 @@ sub get_kernel_data { sub get_kernel_bits { eval $start if $b_log; my $bits = ''; - my @uname = uname(); if (@uname){ - $bits = $uname[scalar @uname - 1]; + $bits = $uname[-1]; $bits = ($bits =~ /64/ ) ? 64 : 32; } $bits ||= 'N/A'; @@ -14922,7 +15012,7 @@ sub get_shell_data { if ( $shell ne 'sh' ) { @app = main::program_values(lc($shell)); if ($app[0]){ - $client{'version'} = main::program_version($shell,$app[0],$app[1],$app[2]); + $client{'version'} = main::program_version($shell,$app[0],$app[1],$app[2],$app[5],$app[6]); } # guess that it's two and --version else { @@ -16316,7 +16406,7 @@ sub generate_system_data { $desktop_info = $desktop_data[4]; } # don't print the desktop if it's a wm and the same - if ($desktop_data[5] && (!$desktop_data[0] || lc($desktop_data[0]) ne lc($desktop_data[5]))){ + if ($desktop_data[5] && (!$desktop_data[0] || index(lc($desktop_data[5]),lc($desktop_data[0])) == -1 )){ $wm = $desktop_data[5]; } } diff --git a/inxi.1 b/inxi.1 index 5bcaccf..9ac5894 100644 --- a/inxi.1 +++ b/inxi.1 @@ -1,4 +1,4 @@ -.TH INXI 1 "2018\-04\-12" inxi "inxi manual" +.TH INXI 1 "2018\-04\-17" inxi "inxi manual" .SH NAME inxi \- Command line system information script for console and IRC .SH SYNOPSIS @@ -78,8 +78,6 @@ capacity, and then this figure as a percentage of original capacity available in \fBcondition: 22.2/36.4 Wh (61%)\fR -The \fBvolts\fR item shows the current voltage / minimum voltage. - .TP .B \-c\fR,\fB \-\-color\fR \fR[\fB0\fR\-\fB42\fR] Set color scheme. If no scheme number is supplied, 0 is assumed. @@ -560,6 +558,9 @@ generate one. \- md\-raid: Adds second RAID Info line with extra data: blocks, chunk size, bitmap (if present). Resync line, shows blocks synced/total blocks. .TP +.B \-xx \-s\fR +\- Adds basic voltages: 12v, 5v, 3.3v, vbat (\fBipmi\fR only). +.TP .B \-x \-S\fR \- Adds desktop toolkit (\fBtk\fR), if available (GNOME/Xfce/KDE only). .TP @@ -584,7 +585,7 @@ bitmap (if present). Resync line, shows blocks synced/total blocks. .TP .B \-xx \-B\fR \- Adds serial number, voltage (if available). Note that \fBvolts\fR shows the -data (if available) as the voltage now / minimum design voltage (\fBnow/min\fR). +data (if available) as the voltage now / minimum design voltage. .TP .B \-xx \-D\fR \- Adds disk serial number. @@ -640,8 +641,11 @@ ROM size if using \fBdmidecode\fR. \- md\-raid: Adds superblock (if present) and algorithm. If resync, shows progress bar. .TP +.B \-xx \-s\fR +\- Adds DIMM/SOC voltages, if present (\fBipmi\fR only). +.TP .B \-xx \-S\fR -\- Adds, if run in X, display manager (\fBdm\fR) type, if present. +\- Adds, if run in X, display manager (\fBdm\fR) type, if present.q If none, shows N/A. Supports most known display managers, including gdm, gdm3, idm, kdm, lightdm, lxdm, mdm, nodm, sddm, slim, tint, wdm, and xdm. .TP diff --git a/inxi.changelog b/inxi.changelog index 0dd489b..923aab8 100644 --- a/inxi.changelog +++ b/inxi.changelog @@ -1,3 +1,32 @@ +===================================================================================== +Version: 3.0.05 +Patch Version: 00 +Script Date: 2018-04-17 +----------------------------------- +Changes: +----------------------------------- +New version, new man. Small new enhancements. + +1. Added to -s for ipmi, with -x: voltage 12v,5v,3.3v,vbat; for -xx, dimm/soc p1/p2 +voltages +2. enhanced wm: feature, needed more filters and protection against redundant data +3. basic apple osx fixes to keep it from crashing, but I'm not spending any more +time on apple junk unless someone pays me for my time, I can't stand the product or +company, it's the total antitheses of freedom or free software, or even openness. +4. openbsd/bsd fixes: openbsd was failing to get cpu flags due to a small oversight +5. -C now shows bits: for the true bits of cpu, not the kernel bits. This is not +a reliable measurement but should be right about 95+ percent of the time, and +basically all of the time for GNU/Linux on Intel/AMD, most of the time for ARM. +When it doesn't know it does not guess, and shows N/A. +6. bsd fix for usb, was running numeric action on string value +7. fixed stderr tool for program_version, now it's hard-coded in program_values +which removes an unneded regex search for every program version test. +8. Mate detection, switched to using mate-sesssion instead of mate-about, the +latter is not getting updated and has the wrong version number on it. + +----------------------------------- +-- Harald Hope - Tue, 17 Apr 2018 13:17:14 -0700 + ===================================================================================== Version: 3.0.04 Patch Version: 00