aboutsummaryrefslogtreecommitdiffstats
path: root/inxi
diff options
context:
space:
mode:
authorLibravatarUnit 193 <unit193@ubuntu.com>2018-07-16 21:12:17 -0400
committerLibravatarUnit 193 <unit193@ubuntu.com>2018-07-16 21:12:17 -0400
commita167eef729ad9265284ae976b17bbab0748bd496 (patch)
treeb0cfb672c725b4b3a99c0dda6c53bc4a87f3a484 /inxi
parent165e3efb98a0aabd33e6b406f3168ae2a665a036 (diff)
downloadinxi-a167eef729ad9265284ae976b17bbab0748bd496.tar.bz2
inxi-a167eef729ad9265284ae976b17bbab0748bd496.tar.xz
inxi-a167eef729ad9265284ae976b17bbab0748bd496.tar.zst
New upstream version 3.0.18-1upstream/3.0.18-1
Diffstat (limited to 'inxi')
-rwxr-xr-xinxi1502
1 files changed, 979 insertions, 523 deletions
diff --git a/inxi b/inxi
index 5776907..a444e66 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.15';
-my $self_date='2018-07-03';
+my $self_version='3.0.18';
+my $self_date='2018-07-16';
my $self_patch='00';
## END INXI INFO ##
@@ -55,9 +55,9 @@ if (eval {require Time::HiRes}){
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
+# ps_aux is full output, ps_cmd is only the last 10 columns to last
my (@app,@dmesg_boot,@dmi,@gpudata,@ifs,@ifs_bsd,@paths,@pci,@ps_aux,
-@ps_cmd,@sysctl,@sysctl_battery,@sysctl_sensors,@sysctl_machine,
+@ps_cmd,@ps_gui,@sysctl,@sysctl_battery,@sysctl_sensors,@sysctl_machine,
@uname,@usb);
## Disk arrays
my (@dm_boot_disk,@dm_boot_optical,@glabel,@gpart,@hardware_raid,@labels,
@@ -65,12 +65,13 @@ my (@dm_boot_disk,@dm_boot_optical,@glabel,@gpart,@hardware_raid,@labels,
my @test = (0,0,0,0,0);
## Booleans
-my ($b_admin,$b_arm,$b_arm_audio,$b_arm_gfx,$b_arm_net,$b_console_irc,
-$b_debug_gz,$b_display,$b_dmesg_boot_check,$b_dmi,$b_dmidecode_force,
-$b_fake_bsd,$b_fake_dboot,$b_fake_pciconf,$b_fake_sysctl,$b_fake_usbdevs,
-$b_force_display,$b_gpudata,$b_irc,$b_log,$b_log_colors,$b_log_full,
-$b_man,$b_mem,$b_pci,$b_pci_tool,$b_proc_debug,$b_root,
-$b_running_in_display,$b_slot_tool,$b_sudo,$b_sysctl,$b_usb_check);
+my ($b_admin,$b_arm,$b_console_irc,$b_debug_gz,$b_debug_timers,
+$b_display,$b_dmesg_boot_check,
+$b_dmi,$b_dmidecode_force,$b_fake_bsd,$b_fake_dboot,$b_fake_pciconf,
+$b_fake_sysctl,$b_fake_usbdevs,$b_force_display,$b_gpudata,$b_irc,
+$b_log,$b_log_colors,$b_log_full,$b_man,$b_mem,$b_mips,$b_pci,$b_pci_tool,
+$b_proc_debug,$b_ps_gui,$b_root,$b_running_in_display,$b_slot_tool,
+$b_soc_audio,$b_soc_gfx,$b_soc_net,$b_sudo,$b_sysctl,$b_usb_check,$b_wmctrl);
## Disk checks
my ($b_dm_boot_disk,$b_dm_boot_optical,$b_glabel,$b_hardware_raid,
$b_label_uuid,$b_lsblk,$b_partitions,$b_raid);
@@ -78,7 +79,7 @@ my ($b_sysctl_disk,$b_update,$b_weather) = (1,1,1);
## System
my ($bsd_type,$language,$os) = ('','','');
-my ($bits_sys);
+my ($bits_sys,$cpu_arch);
my ($cpu_sleep,$dl_timeout,$limit,$ps_count,$usb_level) = (0.35,4,10,5,0);
my $sensors_cpu_nu = 0;
my $weather_unit='mi';
@@ -138,7 +139,7 @@ sub main {
eval $start if $b_log;
initialize();
## use for start client debugging
- # $debug = 10;
+ # $debug = 3; # 3 prints timers
# set_debugger(); # for debugging of konvi issues
#my $ob_start = StartClient->new();
#$ob_start->get_client_data();
@@ -410,12 +411,14 @@ sub set_fake_tools {
sub set_os {
@uname = uname();
$os = lc($uname[0]);
- my $type = lc($uname[-1]);
- $b_arm = 1 if $type =~ /arm|aarch/;
- if ($type =~ /(armv[1-7]|aarch32|sparc_v9)/){
+ $cpu_arch = lc($uname[-1]);
+ if ($cpu_arch =~ /arm|aarch/){$b_arm = 1}
+ elsif ($cpu_arch =~ /mips/) {$b_mips = 1}
+ # aarch32 mips32 intel/amd handled in cpu
+ if ($cpu_arch =~ /(armv[1-7]|32|sparc_v9)/){
$bits_sys = 32;
}
- elsif ($type =~ /(alpha|64)/){
+ elsif ($cpu_arch =~ /(alpha|64)/){
$bits_sys = 64;
}
if ( $os =~ /(bsd|dragonfly|darwin)/ ){
@@ -1089,9 +1092,10 @@ sub begin_logging {
$end='main::log_data("fe", (caller(1))[3], "");';
$start='main::log_data("fs", (caller(1))[3], \@_);';
#$t3 = tv_interval ($t0, [gettimeofday]);
- $t3 = eval 'Time::HiRes::tv_interval (\@t0, [Time::HiRes::gettimeofday()]);' if $b_hires;
+ $t3 = eval 'Time::HiRes::tv_interval (\@t0, [Time::HiRes::gettimeofday()]);' if $b_hires;
#print Dumper $@;
my $now = strftime "%Y-%m-%d %H:%M:%S", localtime;
+ return if $b_debug_timers;
# do the rotation if logfile exists
if ( -f $log_file ){
# copy if present second to third
@@ -1127,8 +1131,7 @@ sub begin_logging {
sub log_data {
return if ! $b_log;
my ($one, $two, $three) = @_;
- my $args = '';
- my $data = '';
+ my ($args,$data,$timer) = ('','','');
my $spacer = ' ';
# print "1: $one 2: $two 3: $three\n";
if ($one eq 'fs') {
@@ -1146,6 +1149,7 @@ sub log_data {
#print Dumper $@;
$data = "Start: Function: $two$args\n${spacer}Elapsed: $t3\n";
$spacer='';
+ $timer = $data if $b_debug_timers;
}
elsif ( $one eq 'fe') {
# print 'timer:', Time::HiRes::tv_interval(\@t0, [Time::HiRes::gettimeofday()]),"\n";
@@ -1154,6 +1158,7 @@ sub log_data {
#print Dumper $t3;
$data = "${spacer}Elapsed: $t3\nEnd: Function: $two\n";
$spacer='';
+ $timer = $data if $b_debug_timers;
}
elsif ( $one eq 'cat') {
if ( $b_log_full ){
@@ -1195,25 +1200,24 @@ sub log_data {
else {
$data = "$two\n";
}
- # print "d: $data";
- if ($data){
+ if ($b_debug_timers){
+ print $timer if $timer;
+ }
+ #print "d: $data";
+ elsif ($data){
print $fh_l "$spacer$data";
}
}
sub set_debugger {
- if ( $debug < 10 || $debug > 12){
- $end = '';
- $start = '';
- if ( $debug >= 20 ){
- error_handler('not-in-irc', 'debug data generator') if $b_irc;
- my $option = ( $debug > 22 ) ? 'main-full' : 'main';
- $b_debug_gz = 1 if ($debug == 22 || $debug == 24);
- my $ob_sys = SystemDebugger->new($option);
- $ob_sys->run_debugger();
- $ob_sys->upload_file($ftp_alt) if $debug > 20;
- exit 0;
- }
+ if ( $debug >= 20){
+ error_handler('not-in-irc', 'debug data generator') if $b_irc;
+ my $option = ( $debug > 22 ) ? 'main-full' : 'main';
+ $b_debug_gz = 1 if ($debug == 22 || $debug == 24);
+ my $ob_sys = SystemDebugger->new($option);
+ $ob_sys->run_debugger();
+ $ob_sys->upload_file($ftp_alt) if $debug > 20;
+ exit 0;
}
elsif ($debug >= 10 && $debug <= 12){
$b_log = 1;
@@ -1225,6 +1229,17 @@ sub set_debugger {
}
begin_logging();
}
+ elsif ($debug <= 3){
+ if ($debug == 3){
+ $b_log = 1;
+ $b_debug_timers = 1;
+ begin_logging();
+ }
+ else {
+ $end = '';
+ $start = '';
+ }
+ }
}
## SystemDebugger
@@ -1302,7 +1317,7 @@ sub create_debug_directory {
my $host = main::get_hostname();
$host =~ s/ /-/g;
$host = 'no-host' if !$host || $host eq 'N/A';
- my ($arm_string,$bsd_string,$root_string) = ('','','');
+ my ($alt_string,$bsd_string,$root_string) = ('','','');
# note: Time::Piece was introduced in perl 5.9.5
my ($sec,$min,$hour,$mday,$mon,$year) = localtime;
$year = $year+1900;
@@ -1319,8 +1334,9 @@ sub create_debug_directory {
$root_string = '-root';
}
$bsd_string = "-BSD-$bsd_type" if $bsd_type;
- $arm_string = '-ARM' if $b_arm;
- $debug_dir = "$self_name$arm_string$bsd_string-$host-$today$root_string-$self_version";
+ if ($b_arm ){$alt_string = '-ARM'}
+ elsif ($b_mips) {$alt_string = '-MIPS'}
+ $debug_dir = "$self_name$alt_string$bsd_string-$host-$today$root_string-$self_version";
$debug_gz = "$debug_dir.tar.gz";
$data_dir = "$user_data_dir/$debug_dir";
if ( -d $data_dir ){
@@ -1488,11 +1504,12 @@ sub display_data {
'desktop-session' => $ENV{'DESKTOP_SESSION'},
'gdmsession' => $ENV{'GDMSESSION'},
'gnome-desktop-session-id' => $ENV{'GNOME_DESKTOP_SESSION_ID'},
- 'kde3-full-session' => $ENV{'KDE_FULL_SESSION'},
- 'kde-gte-4-session-version' => $ENV{'KDE_SESSION_VERSION'},
+ 'kde-full-session' => $ENV{'KDE_FULL_SESSION'},
+ 'kde-session-version' => $ENV{'KDE_SESSION_VERSION'},
'vdpau-driver' => $ENV{'VDPAU_DRIVER'},
'xdg-current-desktop' => $ENV{'XDG_CURRENT_DESKTOP'},
'xdg-session-desktop' => $ENV{'XDG_SESSION_DESKTOP'},
+ 'xdg-vtnr' => $ENV{'XDG_VTNR'},
# wayland data collectors:
'xdg-session-type' => $ENV{'XDG_SESSION_TYPE'},
'wayland-display' => $ENV{'WAYLAND_DISPLAY'},
@@ -1705,6 +1722,8 @@ sub system_files {
push (@files, '/etc/lsb-release');
push (@files, '/etc/os-release');
copy_files(\@files,'system-distro');
+ @files = main::globber('/etc/upstream[-_]{[rR]elease,[vV]ersion}/*');
+ copy_files(\@files,'system-distro');
@files = (
'/proc/1/comm',
'/proc/cpuinfo',
@@ -1993,7 +2012,7 @@ sub wanted {
elsif ($parse_src eq 'proc') {
return if $File::Find::name =~ /^\/proc\/[0-9]+\//;
return if $File::Find::name =~ /^\/proc\/bus\/pci\//;
- return if $File::Find::name =~ /^\/proc\/(irq|sys)\//;
+ return if $File::Find::name =~ /^\/proc\/(irq|spl|sys)\//;
# these choke on sudo/root: kmsg kcore kpage and we don't want keys or kallsyms
return if $File::Find::name =~ /^\/proc\/k/;
return if $File::Find::name =~ /(\/mb_groups|debug)$/;
@@ -2809,8 +2828,8 @@ sub item_data {
'rpm' => 'glx-utils (openSUSE 12.3 and later Mesa-demo-x)',
}),
'wmctrl' => ({
- 'info' => '-S active window manager (not all wm)',
- 'info-bsd' => '-S active window managerr (not all wm)',
+ 'info' => '-S active window manager (fallback)',
+ 'info-bsd' => '-S active window managerr (fallback)',
'apt' => 'wmctrl',
'pacman' => 'wmctrl',
'rpm' => 'wmctrl',
@@ -3053,6 +3072,7 @@ sub joiner {
sub program_values {
my ($app) = @_;
my (@client_data);
+ # note: setting index 1 and 2 to 0 will trip flags to not do version
my %data = (
## Clients
'bitchx' => ['bitchx',2,'','BitchX',1,0,0],# special
@@ -3075,20 +3095,28 @@ sub program_values {
'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
+ ## Desktops / wm
+ '3dwm' => ['^3dwm',0,'0','3dwm',0,1,0], # unknown syntax
+ '9wm' => ['^9wm',3,'-version','9wm',0,1,0],
'afterstep' => ['^afterstep',3,'--version','AfterStep',0,1,0],
+ 'amiwm' => ['^amiwm',0,'0','AmiWM',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],
+ 'compiz' => ['^compiz',2,'--version','Compiz',0,1,0],
+ 'dwm' => ['^dwm',1,'-v','Dwm',0,1,1],
'fluxbox' => ['^fluxbox',2,'--version','Fluxbox',0,1,0],
+ 'flwm' => ['^flwm',0,'0','FLWM',0,0,1],
'fvwm' => ['^fvwm',2,'--version','FVWM',0,0,1],
+ 'fvwm2' => ['^fvwm',2,'--version','FVWM2',0,0,1],
# command: fvwm
'fvwm-crystal' => ['^fvwm',2,'--version','FVWM-Crystal',0,0,0],
+ 'gala' => ['^gala',2,'--version','gala',0,1,0], # super slow result
'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],
+ # fails to return version when in wm, but outside does. weird.
+ 'herbstluftwm' => ['^herbstluftwm',2,'--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,0],
@@ -3098,28 +3126,41 @@ sub program_values {
'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,0],
+ 'lxde' => ['^lxpanel',2,'--version','LXDE',0,1,0],
+ # command: lxqt-panel
+ 'lxqt' => ['^lxqt-panel',2,'--version','LXQt',0,1,0],
+ 'marco' => ['^marco',2,'--version','marco',0,1,0],
+ 'matchbox' => ['^matchbox',0,'0','Matchbox',0,1,0],
+ 'matchbox-window-manager' => ['^matchbox',2,'--help','Matchbox',0,0,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],
+ 'metacity' => ['^metacity',2,'--version','Metacity',0,1,0],
+ 'muffin' => ['^muffin',2,'--version','muffin',0,1,0],
+ 'mwm' => ['^mwm',0,'0','mwm',0,1,0],
+ 'notion' => ['^.',1,'--version','notion',0,1,0],
'openbox' => ['^openbox',2,'--version','Openbox',0,1,0],
- 'pekwm' => ['^pekwm',3,'--version','pekwm',0,1,0],
+ 'pantheon' => ['^pantheon',0,'0','Pantheon',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],
+ 'ratpoison' => ['^ratpoison',2,'--version','Ratpoison',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],
+ 'scrotwm' => ['^scrotwm.*welcome.*',5,'-v','Scrotwm',0,1,1],
+ 'spectrwm' => ['^spectrwm.*welcome.*wm',5,'-v','Spectrwm',0,1,0],
+ 'twm' => ['^twm',0,'0','twm',0,1,0],
'unity' => ['^unity',2,'--version','Unity',0,1,0],
- 'wm2' => ['^wm2',-1,'--version','WM2',0,1,0],
+ 'windowlab' => ['^windowlab',2,'-about','WindowLab',0,1,0],
+ 'wm2' => ['^wm2',0,'0','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
+ 'wmii' => ['^wmii',0,'0','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,0],
+ 'xmonad' => ['^xmonad',2,'--version','XMonad',0,1,0],
## Shells
'bash' => ['^GNU[[:space:]]bash,[[:space:]]version',4,'--version','Bash',1,0,0],
'csh' => ['^tcsh',2,'--version','csh',1,0,0],
@@ -3157,6 +3198,7 @@ sub program_version {
my ($cmd,$line,$output);
my $version_nu = '';
my $count = 0;
+ #print "app:$app\n";
$exit ||= 100; # basically don't exit ever
$version ||= '--version';
# adjust to array index, not human readable
@@ -3282,6 +3324,7 @@ sub uniq {
grep !$seen{$_}++, @_;
}
+
# arg: 1 file full path to write to; 2 - arrayof data to write.
# note: turning off strict refs so we can pass it a scalar or an array reference.
sub writer {
@@ -3861,7 +3904,7 @@ sub get_options{
}},
'debug:i' => sub {
my ($opt,$arg) = @_;
- if ($arg =~ /^[1-3]|1[0-2]|2[0-4]$/){
+ if ($arg =~ /^[1-3]|1[0-3]|2[0-4]$/){
$debug=$arg;
}
else {
@@ -4004,6 +4047,8 @@ sub get_options{
} },
'V|version' => sub {
$b_version = 1 },
+ 'wm' => sub {
+ $b_wmctrl = 1 },
'<>' => sub {
my ($opt) = @_;
error_handler('unknown-option', "$opt", "" ); }
@@ -4078,7 +4123,7 @@ sub show_options {
Examples:^$self_name^-v4^-c6 OR
$self_name^-bDc^6. If you start $self_name with no arguments, it will display
a short system summary." ],
- [0, '', '', '' ],
+ ['0', '', '', '' ],
['0', '', '', "The following options, if used without -F, -b, or -v, will
show option line(s): A, B, C, D, G, I, M, N, P, R, S, W, d, f, i, l, m, n,
o, p, r, s, t, u, w, --slots, --usb - you can use these alone or together
@@ -4156,7 +4201,7 @@ sub show_options {
(memory), cm (CPU+memory). If followed by numbers 1-x, shows that number
of processes for each type (default: 5; if in IRC, max: 5). " ],
['1', '', '', "Make sure that there is no space between letters and
- numbers (e.g. write as^-t^cm10)." ],
+ numbers (e.g.^-t^cm10)." ],
['1', '', '--usb', "Show USB data: Hubs and Devices." ],
['1', '-u', '--uuid', "$partition_string_u UUIDs. Triggers -P. For full -p
output, use -pu." ],
@@ -4186,11 +4231,11 @@ sub show_options {
@rows = (
['1', '-w', '--weather', "Local weather data/time. To check an alternate
location, see -W."],
- ['1', '-W', '--weather-location', "<location> Supported options for
- <location>: postal code; city, state/country; latitude, longitude.
+ ['1', '-W', '--weather-location', "[location] Supported options for
+ [location]: postal code; city, state/country; latitude, longitude.
Only use if you want the weather somewhere other than the machine running
- $self_name. Use only ASCII characters, replace spaces in city/state/country names with '+'.
- Example:^$self_name^-W^new+york,ny"],
+ $self_name. Use only ASCII characters, replace spaces in city/state/country
+ names with '+'. Example:^$self_name^-W^new+york,ny"],
['1', '', '--weather-unit', "Set weather units to metric (m), imperial (i),
metric/imperial (mi), or imperial/metric (im)."],
);
@@ -4222,8 +4267,8 @@ sub show_options {
blocks, chunk size, bitmap (if present). Resync line, shows blocks
synced/total blocks. Hardware RAID driver version, bus ID." ],
['2', '-s', '', "Basic voltages (ipmi, lm-sensors if present): 12v, 5v, 3.3v, vbat." ],
- ['2', '-S', '', "Desktop toolkit, if available (GNOME/Xfce/KDE only);
- Kernel gcc version; system base of distro (if relevant and detected)" ],
+ ['2', '-S', '', "Kernel gcc version; system base of distro (if relevant
+ and detected)" ],
['2', '-t', '', "Adds memory use output to CPU (-xt c), and CPU use to
memory (-xt m)." ],
['2', '--usb', '', "For Devices, shows USB version/speed." ],
@@ -4254,8 +4299,9 @@ sub show_options {
['2', '-R', '', "md-raid: Superblock (if present), algorithm. If resync,
shows progress bar. Hardware RAID Chip vendor:product ID." ],
['2', '-s', '', "DIMM/SOC voltages (ipmi only)." ],
- ['2', '-S', '', "Display manager (dm) in desktop output if in X (e.g. kdm,
- gdm3, lightdm)." ],
+ ['2', '-S', '', "Display manager (dm) in desktop output (e.g. kdm,
+ gdm3, lightdm); active window manager if detected; desktop toolkit,
+ if available (Xfce/KDE/Trinity only)." ],
['2', '--slots', '', "Slot length." ],
['2', '--usb', '', "Vendor:chip ID." ],
);
@@ -4267,18 +4313,23 @@ sub show_options {
@rows = (
['1', '-xxx', '--extra 3', "Show extra, extra, extra data (only works
with verbose or line output, not short form):" ],
+ ['2', '-A', '', "Specific vendor/product information (if relevant)." ],
['2', '-B', '', "Chemistry, cycles, location (if available)." ],
+ ['2', '-C', '', "CPU boost (turbo) enabled/disabled, if present." ],
['2', '-D', '', "Firmware rev. if available; partition scheme, in some cases; disk
rotation speed (if detected)." ],
+ ['2', '-G', '', "Specific vendor/product information (if relevant)." ],
['2', '-I', '', "For 'Shell:' adds ([su|sudo|login]) to shell name if present;
for 'running in:' adds (SSH) if SSH session." ],
['2', '-m', '', "Width of memory bus, data and total (if present and greater
- than data); Detail for Type, if present; module voltage, if available; serial number." ],
+ than data); Detail for Type, if present; module voltage, if available; serial
+ number." ],
['2', '-R', '', "zfs-raid: portion allocated (used) by RAID devices/arrays.
md-raid: system md-raid support types (kernel support, read ahead, RAID events).
- Hardware RAID rev, ports." ],
- ['2', '-S', '', "Panel/shell info in desktop output, if in X (like gnome-shell,
- cinnamon, mate-panel); (if available) dm version number, active window manager." ]
+ Hardware RAID rev, ports, specific vendor/product information." ],
+ ['2', '-S', '', "Panel/shell info in desktop output, if in X (like lxpanel,
+ xfce4-panel, mate-panel); (if available) dm version number, window manager
+ version number." ]
);
push @data, @rows;
if ( $b_weather ){
@@ -4322,28 +4373,9 @@ sub show_options {
}
@rows = (
['1', '-V', '--version', "Prints $self_name version info then exits." ],
- [0, '', '', "$line" ],
- [0, '', '', "Debugging Options:" ],
- ['1', '', '--debug', "Triggers debugging modes." ],
- ['2', '1-3', '', "On screen debugger output." ],
- ['2', '10', '', "Basic logging." ],
- ['2', '11', '', "Full file/system info logging." ],
- ['1', '', ,'', "The following create a tar.gz file of system data, plus $self_name
- output. To automatically upload debugger data tar.gz file
- to ftp.techpatterns.com: $self_name^--debug^21" ],
- ['2', '20', '', "Full system data collection: /sys; xorg conf and log data, xrandr,
- xprop, xdpyinfo, glxinfo etc.; data from dev, disks,
- ${partition_string}s, etc." ],
- ['2', '21', '', "Upload debugger dataset to $self_name debugger server
- automatically, removes debugger data directory, leaves tar.gz debugger file." ],
- ['2', '22', '', "Upload debugger dataset to $self_name debugger server
- automatically, removes debugger data directory and debugger tar.gz file." ],
- ['1', '', '--ftp', "Use with --debugger 21 to trigger an alternate FTP server for upload.
- Format:^[ftp.xx.xx/yy]. Must include a remote directory to upload to.
- Example:^$self_name^--debug^21^--ftp^ftp.myserver.com/incoming" ],
- [0, '', '', "$line" ],
- [0, '', '', "Advanced Options:" ],
- [1, '', '--alt', "Trigger for various advanced options:" ],
+ ['0', '', '', "$line" ],
+ ['0', '', '', "Advanced Options:" ],
+ ['1', '', '--alt', "Trigger for various advanced options:" ],
['2', '40', '', "Bypass Perl as a downloader option." ],
['2', '41', '', "Bypass Curl as a downloader option." ],
['2', '42', '', "Bypass Fetch as a downloader option." ],
@@ -4386,7 +4418,27 @@ 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', '', '--wm', "Force wm: to use wmctrl as data source. Default uses ps." ],
['0', '', '', $line ],
+ ['0', '', '', "Debugging Options:" ],
+ ['1', '', '--debug', "Triggers debugging modes." ],
+ ['2', '1-3', '', "On screen debugger output." ],
+ ['2', '10', '', "Basic logging." ],
+ ['2', '11', '', "Full file/system info logging." ],
+ ['1', '', ,'', "The following create a tar.gz file of system data, plus $self_name
+ output. To automatically upload debugger data tar.gz file
+ to ftp.techpatterns.com: $self_name^--debug^21" ],
+ ['2', '20', '', "Full system data collection: /sys; xorg conf and log data, xrandr,
+ xprop, xdpyinfo, glxinfo etc.; data from dev, disks,
+ ${partition_string}s, etc." ],
+ ['2', '21', '', "Upload debugger dataset to $self_name debugger server
+ automatically, removes debugger data directory, leaves tar.gz debugger file." ],
+ ['2', '22', '', "Upload debugger dataset to $self_name debugger server
+ automatically, removes debugger data directory and debugger tar.gz file." ],
+ ['1', '', '--ftp', "Use with --debugger 21 to trigger an alternate FTP server for upload.
+ Format:^[ftp.xx.xx/yy]. Must include a remote directory to upload to.
+ Example:^$self_name^--debug^21^--ftp^ftp.myserver.com/incoming" ],
+ ['0', '', '', "$line" ],
);
push @data, @rows;
print_basic(@data);
@@ -4813,6 +4865,13 @@ sub apply_filter {
}
return $string;
}
+sub arm_cleaner {
+ my ($item) = @_;
+ $item =~ s/(\(?Device Tree\)?)//gi;
+ $item =~ s/\s\s+/ /g;
+ $item =~ s/^\s+|\s+$//g;
+ return $item;
+}
sub clean_characters {
my ($data) = @_;
@@ -4930,21 +4989,27 @@ sub memory_data_full {
my ($source) = @_;
my $num = 0;
my ($memory,@rows);
- my ($percent,$total,$used) = ('','','');
+ my ($gpu_ram,$percent,$total,$used) = (0,'','','');
if (!$show{'info'}){
$memory = get_memory_data('splits');
if ($memory){
my @temp = split /:/, $memory;
my @temp2 = get_size($temp[0]);
+ $gpu_ram = $temp[3] if $temp[3];
$total = ($temp2[1]) ? $temp2[0] . ' ' . $temp2[1] : $temp2[0];
@temp2 = get_size($temp[1]);
$used = ($temp2[1]) ? $temp2[0] . ' ' . $temp2[1] : $temp2[0];
$used .= " ($temp[2]%)" if $temp[2];
+ if ($gpu_ram){
+ @temp2 = get_size($gpu_ram);
+ $gpu_ram = $temp2[0] . ' ' . $temp2[1] if $temp2[1];
+ }
}
my $key = ($source eq 'process') ? 'System RAM': 'RAM';
$rows[0]{main::key($num++,$key)} = '';
$rows[0]{main::key($num++,'total')} = $total;
$rows[0]{main::key($num++,'used')} = $used;
+ $rows[0]{main::key($num++,'gpu')} = $gpu_ram if $gpu_ram;
}
$b_mem = 1;
eval $end if $b_log;
@@ -4954,7 +5019,7 @@ sub memory_data_full {
sub pci_cleaner {
my ($string,$type) = @_;
#print "st1 $type:$string\n";
- my $filter = 'compatible\scontroller|\b(device|controller|multimedia)\b|\([^)]+\)';
+ my $filter = 'compatible\scontroller|\b(device|controller|connection|multimedia)\b|\([^)]+\)';
# \[[^\]]+\]$| not trimming off ending [...] initial type filters removes end
$filter = '\[[^\]]+\]$|' . $filter if $type eq 'pci';
$string =~ s/$filter//ig;
@@ -4964,6 +5029,17 @@ sub pci_cleaner {
$string = remove_duplicates($string) if $string;
return $string;
}
+sub pci_cleaner_subsystem {
+ my ($string) = @_;
+ # we only need filters for features that might use vendor, -AGN
+ my $filter = 'adapter|(hd\s)?audio|definition|desktop|ethernet|gigabit|graphics|';
+ $filter .= 'hdmi(\/[\S]+)?|high|integrated|motherboard|network|onboard|';
+ $filter .= 'raid|pci\s?express';
+ $string =~ s/\b($filter)\b//gi;
+ $string =~ s/\s\s+/ /g;
+ $string =~ s/^\s+|\s+$//g;
+ return $string;
+}
sub pci_long_filter {
my ($string) = @_;
@@ -4982,7 +5058,7 @@ sub row_defaults {
'battery-data' => "No system battery data found. Is one present?",
'battery-data-sys' => "No /sys data found. Old system?",
'cpu-model-null' => "Model N/A",
- 'cpu-speeds' => "No non 0 speed data found for $id cores.",
+ 'cpu-speeds' => "No speed data found for $id cores.",
'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.",
@@ -5002,6 +5078,7 @@ sub row_defaults {
'machine-data-bsd' => "No machine data: Is dmidecode installed? Try -M --dmidecode.",
'machine-data-dmidecode' => "No machine data: try newer kernel. Is dmidecode installed? Try -M --dmidecode.",
'machine-data-force-dmidecode' => "No machine data: try newer kernel. Is dmidecode installed? Try -M --dmidecode.",
+ 'mips-pci' => "No MIPS data found for this feature.",
'optical-data' => "No Optical or Floppy data was found.",
'optical-data-bsd' => "No floppy or optical data found for this BSD system.",
'output-limit' => "Output throttled. IPs: $id; Limit: $limit; Override: --limit [1-x;-1 all]",
@@ -5495,10 +5572,10 @@ sub get {
eval $start if $b_log;
my (@data,@rows);
my $num = 0;
- if ($b_arm && !$b_arm_audio && !$b_pci_tool){
- my $key = 'ARM';
+ if (($b_arm || $b_mips) && !$b_soc_audio && !$b_pci_tool){
+ my $key = ($b_arm) ? 'ARM' : 'MIPS';
@data = ({
- main::key($num++,$key) => main::row_defaults('arm-pci',''),
+ main::key($num++,$key) => main::row_defaults(lc($key) . '-pci',''),
},);
@rows = (@rows,@data);
}
@@ -5506,7 +5583,8 @@ sub get {
@data = card_data();
@rows = (@rows,@data);
}
- if ( ( ($b_arm && !$b_arm_audio && !$b_pci_tool) || !@rows ) && (my $file = main::system_files('asound-cards') ) ){
+ if ( ( (($b_arm || $b_mips) && !$b_soc_audio && !$b_pci_tool) || !@rows ) &&
+ (my $file = main::system_files('asound-cards') ) ){
@data = asound_data($file);
@rows = (@rows,@data);
}
@@ -5532,7 +5610,7 @@ sub card_data {
foreach (@pci){
$num = 1;
my @row = @$_;
- if ($row[0] =~ /^(audio|multimedia|hdmi)$/){
+ if ($row[0] =~ /^(audio|daudio|hdmi|multimedia)$/){
$j = scalar @rows;
my $driver = $row[9];
$driver ||= 'N/A';
@@ -5544,9 +5622,13 @@ sub card_data {
}
@data = ({
main::key($num++,'Card') => $card,
- main::key($num++,'driver') => $driver,
},);
@rows = (@rows,@data);
+ if ($extra > 2 && $b_pci_tool && $row[11]){
+ my $item = main::get_pci_vendor($row[4],$row[11]);
+ $rows[$j]{main::key($num++,'vendor')} = $item if $item;
+ }
+ $rows[$j]{main::key($num++,'driver')} = $driver;
if ($extra > 0 && !$bsd_type){
if ($row[9] ){
my $version = main::get_module_version($row[9]);
@@ -6274,9 +6356,13 @@ sub create_output_full {
@data = ({
main::key($num++,$speed_key) => $speed,
main::key($num++,$min_max_key) => $min_max,
- main::key($num++,$core_key) => $core_speeds_value,
- }, );
+ });
@rows = (@rows,@data);
+ if ($extra > 2){
+ my $boost = get_boost_status();
+ $rows[$j]{main::key($num++,'boost')} = $boost if $boost;
+ }
+ $rows[$j]{main::key($num++,$core_key)} = $core_speeds_value;
my $i = 1;
# if say 96 0 speed cores, no need to print all those 0s
if ($b_speeds){
@@ -6427,6 +6513,7 @@ sub data_cpuinfo {
# $file = "$ENV{'HOME'}/bin/scripts/inxi/data/cpu/intel/2-1-core-xeon-vm-vs2017.txt";
# $file = "$ENV{'HOME'}/bin/scripts/inxi/data/cpu/intel/4-1-core-xeon-vps-frodo1.txt";
# $file = "$ENV{'HOME'}/bin/scripts/inxi/data/cpu/intel/4-6-core-xeon-no-mt-lathander.txt";
+ #$file = "$ENV{'HOME'}/bin/scripts/inxi/data/cpu/mips/mips-mainusg-cpuinfo.txt";
my %speeds = set_cpu_speeds_sys();
my @cpuinfo = main::reader($file);
my @phys_cpus = (0);# start with 1 always
@@ -6517,7 +6604,7 @@ sub data_cpuinfo {
$cpu{'model_id'} =~ s/^0X//;
}
# cpu can show in arm
- elsif (!$cpu{'model_name'} &&( $line[0] eq 'model name' || $line[0] eq 'cpu' )){
+ elsif (!$cpu{'model_name'} && ( $line[0] eq 'model name' || $line[0] eq 'cpu' || $line[0] eq 'cpu model' )){
$cpu{'model_name'} = main::cleaner($line[1]);
$cpu{'model_name'} = cpu_cleaner($cpu{'model_name'});
if ( $b_arm || $line[1] =~ /ARM|AArch/i){
@@ -6533,6 +6620,10 @@ sub data_cpuinfo {
#$cpu{'processors'}[$proc_count] = 0;
}
}
+ elsif ($b_mips || $line[1] =~ /mips/i){
+ $b_mips = 1;
+ $cpu{'type'} = 'mips';
+ }
}
elsif ( $line[0] eq 'cpu mhz' ){
$speed = speed_cleaner($line[1]);
@@ -6634,6 +6725,7 @@ sub data_cpuinfo {
$cpu{'ids'} = (\@ids);
if ( $extra > 0 && !$cpu{'arch'} && $type ne 'short' ){
$cpu{'arch'} = cpu_arch($cpu{'type'},$cpu{'family'},$cpu{'model_id'});
+ $cpu{'arch'} = $cpu_arch if (!$cpu{'arch'} && $cpu_arch && ($b_mips || $b_arm))
#print "$cpu{'type'},$cpu{'family'},$cpu{'model_id'},$cpu{'arch'}\n";
}
if (!$speeds{'cur-freq'}){
@@ -7088,7 +7180,7 @@ sub set_cpu_speeds_sys {
if ($b_arm){
@arm = 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.
+ # 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){
@@ -7197,7 +7289,19 @@ sub cpu_vendor {
eval $end if $b_log;
return $vendor;
}
-
+sub get_boost_status {
+ eval $start if $b_log;
+ my ($boost);
+ my $path = '/sys/devices/system/cpu/cpufreq/boost';
+ if (-f $path){
+ $boost = (main::reader($path))[0];
+ if (defined $boost && $boost =~/^[01]$/){
+ $boost = ($boost) ? 'enabled' : 'disabled';
+ }
+ }
+ eval $end if $b_log;
+ return $boost;
+}
sub arm_cpu_name {
eval $start if $b_log;
my (%cpus,$compat);
@@ -7523,7 +7627,8 @@ sub create_output {
}
$used ||= 'N/A';
@data = ({
- main::key($num++,'HDD Total Size') => $size,
+ main::key($num++,'Local Storage') => '',
+ main::key($num++,'total') => $size,
main::key($num++,'used') => $used,
});
@rows = (@rows,@data);
@@ -8097,9 +8202,7 @@ sub device_vendor {
my (@data);
return if !$model;
# 0 - match pattern; 1 - replace pattern; 2 - vendor print; 3 - serial pattern
- # https://elinux.org/RPi_SD_cards
- # https://sd2snes.de/blog/card-list
- # https://www.superbiiz.com # lists by real part numbers
+ # Data URLs: inxi-resources.txt Section: DiskData device_vendor()
my @vendors = (
## These go first because they are the most likely and common ##
['(Crucial|^CT|-CT|^M4-)','Crucial','Crucial',''],
@@ -8110,8 +8213,8 @@ sub device_vendor {
# MU = Multiple_Flash_Reader too risky: |M[UZ][^L]
['(SAMSUNG|^MCG[0-9]+GC)','SAMSUNG','Samsung',''], # maybe ^SM
['(SanDisk|^SDS[S]?[DQ]|^SL([0-9]+)G|^AFGCE|ULTRA\sFIT|Cruzer)','SanDisk','SanDisk',''],
- ['(^ST[^T]|[S]?SEAGATE|^X[AFP])','[S]?SEAGATE','Seagate',''], # real, SSEAGATE Backup+; XP1600HE30002
- ['^(WD|Western Digital|My Passport|00LPCX|Elements)','(^WDC|Western Digital)','Western Digital',''],
+ ['(^ST[^T]|[S]?SEAGATE|^X[AFP]|^BUP|Expansion Desk)','[S]?SEAGATE','Seagate',''], # real, SSEAGATE Backup+; XP1600HE30002
+ ['^(WD|Western Digital|My (Book|Passport)|00LPCX|Elements)','(^WDC|Western Digital)','Western Digital',''],
## Then better known ones ##
['^(A-DATA|ADATA|AXN)','^(A-DATA|ADATA)','A-Data',''],
['^ADTRON','^(ADTRON)','Adtron',''],
@@ -8120,7 +8223,9 @@ sub device_vendor {
['^Corsair','^Corsair','Corsair',''],
['^(FUJITSU|MP)','^FUJITSU','Fujitsu',''],
# note: 2012: wdc bought hgst
- ['^(Hitachi|HGST|IC|HT|HU)','^Hitachi','Hitachi',''], # HGST HUA
+ ['^(HGST)','^HGST','HGST (Hitachi)',''], # HGST HUA
+ ['^(Hitachi|HDS|IC|HT|HU)','^Hitachi','Hitachi',''],
+ ['^Hoodisk','^Hoodisk','Hoodisk',''],
['^(HP\b)','^HP','HP',''], # vb: VB0250EAVER but clashes with vbox; HP_SSD_S700_120G
['^(LSD|Lexar)','^Lexar','Lexar',''], # mmc-LEXAR_0xb016546c
# OCZSSD2-2VTXE120G is OCZ-VERTEX2_3.5
@@ -8135,10 +8240,11 @@ sub device_vendor {
## These go last because they are short and could lead to false ID, or are unlikely ##
['^Android','^Android','Android',''],
# must come before AP|Apacer
- ['^APPLE','','^APPLE','Apple'],
+ ['^APPLE','^APPLE','Apple',''],
['^(AP|Apacer)','^Apacer','Apacer',''],
['^BUFFALO','^BUFFALO','Buffalo',''],
['^CHN\b','','Zheino',''],
+ ['^Colorful\b','^Colorful','Colorful',''],
['^DREVO\b','','Drevo',''],
['^EXCELSTOR','^EXCELSTOR( TECHNOLOGY)?','Excelstor',''],
['^FASTDISK','^FASTDISK','FASTDISK',''],
@@ -8154,6 +8260,7 @@ sub device_vendor {
['^(InnoDisk|Innolite)','^InnoDisk( Corp.)?','InnoDisk',''],
['^Innostor','^Innostor','Innostor',''],
['^Intenso','^Intenso','Intenso',''],
+ ['^KingDian','^KingDian','KingDian',''],
['^(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',''],
@@ -8171,7 +8278,8 @@ sub device_vendor {
['^RIM[\s]','^RIM','RIM',''],
['^SigmaTel','^SigmaTel','SigmaTel',''],
['^SPPC','','Silicon Power',''],
- ['^(SK HYNIX|SKHYNIX|HFS)','^(SK HYNIX|SKHYNIX)','SK Hynix',''], # HFS128G39TND-N210A
+ ['^(SK\s?HYNIX|HFS)','^SK\s?HYNIX','SK Hynix',''], # HFS128G39TND-N210A
+ ['^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',''],
['^(S[FR]-|Sony)','^Sony','Sony',''],
@@ -8186,6 +8294,7 @@ sub device_vendor {
['^TEAC','^TEAC','TEAC',''],
['^(TS|Transcend|JetFlash)','^Transcend','Transcend',''],
['^TrekStor','^TrekStor','TrekStor',''],
+ ['^UDinfo','^UDinfo','UDinfo',''],
['^(UG|Unigen)','^Unigen','Unigen',''],
['^VBOX','','VirtualBox',''],
['^(Verbatim|STORE N GO)','^Verbatim','Verbatim',''],
@@ -8354,10 +8463,10 @@ sub get {
eval $start if $b_log;
my (@data,@rows);
my $num = 0;
- if ($b_arm && !$b_arm_gfx && !$b_pci_tool){
- my $key = 'ARM';
+ if (($b_arm || $b_mips) && !$b_soc_gfx && !$b_pci_tool){
+ my $key = ($b_arm) ? 'ARM' : 'MIPS';
@data = ({
- main::key($num++,$key) => main::row_defaults('arm-pci',''),
+ main::key($num++,$key) => main::row_defaults(lc($key) . '-pci',''),
},);
@rows = (@rows,@data);
}
@@ -8403,7 +8512,7 @@ sub card_data {
$num = 1;
my @row = @$_;
#print "$row[0] $row[3]\n";
- if ($row[3] == 0 && ( $row[0] =~ /^(vga|display|3d|fb|gpu|hdmi)$/ ) ){
+ if ($row[3] == 0 && ( $row[0] =~ /^(vga|disp|display|3d|fb|gpu|hdmi)$/ ) ){
#print "$row[0] $row[3]\n";
$j = scalar @rows;
$driver = $row[9];
@@ -8415,13 +8524,15 @@ sub card_data {
if (length($card) > 85 || $size{'max'} < 110){
$card = main::pci_long_filter($card);
}
- @data = (
- {
+ @data = ({
main::key($num++,'Card') => $card,
- main::key($num++,'driver') => $driver,
- },
- );
+ },);
@rows = (@rows,@data);
+ if ($extra > 2 && $b_pci_tool && $row[11]){
+ my $item = main::get_pci_vendor($row[4],$row[11]);
+ $rows[$j]{main::key($num++,'vendor')} = $item if $item;
+ }
+ $rows[$j]{main::key($num++,'driver')} = $driver;
if ($row[9] && !$bsd_type){
my $version = main::get_module_version($row[9]);
$version ||= 'N/A';
@@ -8754,7 +8865,7 @@ sub tty_data(){
$tty = "$size{'term-cols'}x$size{'term-lines'}";
}
elsif ($b_irc && $client{'console-irc'}){
- my $tty_working = main::get_tty_console_irc();
+ my $tty_working = main::get_tty_console_irc('tty');
if (my $program = main::check_program('stty')){
my $tty_arg = ($bsd_type) ? '-f' : '-F';
$tty = (main::grabber("$program $tty_arg /dev/pts/$tty_working size 2>/dev/null"))[0];
@@ -8891,73 +9002,49 @@ sub display_compositor {
eval $start if $b_log;
my ($protocol) = @_;
my ($compositor) = ('');
- # NOTE: chains of greps of ps data are VERY expensive, so check for program presence
- if (main::check_program('mutter') && (grep {/mutter/} @ps_cmd ) ) {
- $compositor = 'mutter';
- }
- elsif (main::check_program('kwin_wayland') && (grep {/\bkwin_wayland\b/} @ps_cmd ) ) {
- $compositor = 'kwin_wayland';
- }
- elsif (main::check_program('kwin') && (grep {/\bkwin\b/} @ps_cmd ) ) {
- $compositor = 'kwin';
- }
- elsif (main::check_program('muffin') && (grep {/muffin/} @ps_cmd ) ) {
- $compositor = 'muffin';
- }
- # Note: other strings have gnome-shell in them, so important to get exact one. Since we
- # can't fully trust how this will appear, the pattern should tighten it
- elsif (main::check_program('gnome-shell') && (grep {/^(\/[\S]+\/)?gnome-shell(\s|$)/} @ps_cmd ) ) {
- $compositor = 'gnome-shell';
- }
- elsif (main::check_program('weston') && (grep {/weston/} @ps_cmd ) ) {
- $compositor = 'weston';
- }
- elsif (main::check_program('compton') && (grep {/compton/} @ps_cmd ) ) {
- $compositor = 'compton';
- }
- # owned by: compiz-core in debian
- elsif (main::check_program('compiz') && (grep {/compiz/} @ps_cmd ) ) {
- $compositor = 'compiz';
- }
- # did not find in debian apt
- elsif (main::check_program('moblin') && (grep {/moblin/} @ps_cmd ) ) {
- $compositor = 'moblin';
- }
- # did not find in debian apt
- elsif (main::check_program('kmscon') && (grep {/kmscon/} @ps_cmd ) ) {
- $compositor = 'kmscon';
- }
- # did not find in debian apt
- elsif (main::check_program('sway') && (grep {/\bsway\b/} @ps_cmd ) ) {
- $compositor = 'sway';
- }
- # did not find in debian apt
- elsif (main::check_program('grefson') && (grep {/grefson/} @ps_cmd ) ) {
- $compositor = 'grefson';
- }
- # did not find in debian apt
- elsif (main::check_program('westford') && (grep {/westford/} @ps_cmd ) ) {
- $compositor = 'westford';
- }
- # did not find in debian apt
- elsif (main::check_program('rustland') && (grep {/rustland/} @ps_cmd ) ) {
- $compositor = 'rustland';
- }
- # did not find in debian apt
- elsif (main::check_program('ireplace') && (grep {/fireplace/} @ps_cmd ) ) {
- $compositor = 'fireplace';
- }
- # did not find in debian apt
- elsif (main::check_program('wayhouse') && (grep {/wayhouse/} @ps_cmd ) ) {
- $compositor = 'wayhouse';
- }
- # did not find in debian apt
- elsif (main::check_program('swc') && (grep {/\bswc\b/} @ps_cmd ) ) {
- $compositor = 'swc';
- }
- # did not find in debian apt
- elsif (main::check_program('dwc') && (grep {/\bdwc\b/} @ps_cmd ) ) {
- $compositor = 'dwc';
+ main::set_ps_gui() if ! $b_ps_gui;
+ if (@ps_gui){
+ # 1 check program; 2 search; 3 unused version; 4 print
+ my @compositors = (
+ ['budgie-wm','budgie-wm','','budgie-wm'],
+ ['compton','compton','','compton'],
+ ['enlightenment','enlightenment','','enlightenment'],
+ ['gnome-shell','gnome-shell','','gnome-shell'],
+ ['kwin_wayland','kwin_wayland','','kwin wayland'],
+ ['kwin_x11','kwin_x11','','kwin x11'],
+ #['kwin','kwin','','kwin'],
+ ['marco','marco','','marco'],
+ ['muffin','muffin','','muffin'],
+ ['mutter','mutter','','mutter'],
+ ['weston','weston','','weston'],
+ # owned by: compiz-core in debian
+ ['compiz','compiz','','compiz'],
+ # did not find follwing in debian apt
+ ['3dwm','3dwm','','3dwm'],
+ ['dwc','dwc','','dwc'],
+ ['grefson','grefson','','grefson'],
+ ['ireplace','ireplace','','ireplace'],
+ ['kmscon','kmscon','','kmscon'],
+ ['metisse','metisse','','metisse'],
+ ['mir','mir','','mir'],
+ ['moblin','moblin','','moblin'],
+ ['rustland','rustland','','rustland'],
+ ['sway','sway','','sway'],
+ ['swc','swc','','swc'],
+ ['unagi','unagi','','unagi'],
+ ['wayhouse','wayhouse','','wayhouse'],
+ ['westford','westford','','westford'],
+ ['xcompmgr','xcompmgr','','xcompmgr'],
+ );
+ foreach my $ref (@compositors){
+ my @item = @$ref;
+ # no need to use check program with short list of ps_gui
+ # if (main::check_program($item[0]) && (grep {/^$item[1]$/} @ps_gui ) ){
+ if (grep {/^$item[1]$/} @ps_gui){
+ $compositor = $item[3];
+ last;
+ }
+ }
}
main::log_data('data',"compositor: $compositor") if $b_log;
eval $end if $b_log;
@@ -8971,7 +9058,7 @@ package MachineData;
sub get {
eval $start if $b_log;
- my (%arm_machine,@data,@rows,$key1,$val1,$which);
+ my (%soc_machine,@data,@rows,$key1,$val1,$which);
my $num = 0;
if ($bsd_type && @sysctl_machine && !$b_dmidecode_force ){
@data = machine_data_sysctl();
@@ -9004,11 +9091,9 @@ sub get {
}
elsif (!$bsd_type) {
# this uses /proc/cpuinfo so only GNU/Linux
- if ($b_arm){
- %arm_machine = machine_data_arm();
- if (%arm_machine){
- @data = create_output_arm(%arm_machine);
- }
+ if ($b_arm || $b_mips){
+ %soc_machine = machine_data_soc();
+ @data = create_output_soc(%soc_machine) if %soc_machine;
}
if (!@data){
$key1 = 'Message';
@@ -9154,37 +9239,38 @@ sub create_output {
eval $end if $b_log;
return @rows;
}
-sub create_output_arm {
+sub create_output_soc {
my (%data,@row,@rows);
- my (%arm_machine) = @_;
+ my (%soc_machine) = @_;
my $num = 0;
my $j = 0;
- #print Data::Dumper::Dumper \%arm_machine;
+ #print Data::Dumper::Dumper \%soc_machine;
# this is sketchy, /proc/device-tree/model may be similar to Hardware value from /proc/cpuinfo
# raspi: Hardware : BCM2835 model: Raspberry Pi Model B Rev 2
- if ($arm_machine{'device'} || $arm_machine{'model'}){
- $rows[$j]{main::key($num++,'Type')} = 'ARM Device';
+ if ($soc_machine{'device'} || $soc_machine{'model'}){
+ my $key = ($b_arm) ? 'ARM Device': 'MIPS Device';
+ $rows[$j]{main::key($num++,'Type')} = $key;
my $system = 'System';
- if (defined $arm_machine{'model'}){
- $rows[$j]{main::key($num++,'System')} = $arm_machine{'model'};
+ if (defined $soc_machine{'model'}){
+ $rows[$j]{main::key($num++,'System')} = $soc_machine{'model'};
$system = 'details';
}
- my $device = $arm_machine{'device'};
+ my $device = $soc_machine{'device'};
$device ||= 'N/A';
$rows[$j]{main::key($num++,$system)} = $device;
}
# we're going to print N/A for 0000 values sine the item was there.
- if ($arm_machine{'firmware'}){
+ if ($soc_machine{'firmware'}){
# most samples I've seen are like: 0000
- $arm_machine{'firmware'} =~ s/^[0]+$//;
- $arm_machine{'firmware'} ||= 'N/A';
- $rows[$j]{main::key($num++,'rev')} = $arm_machine{'firmware'};
+ $soc_machine{'firmware'} =~ s/^[0]+$//;
+ $soc_machine{'firmware'} ||= 'N/A';
+ $rows[$j]{main::key($num++,'rev')} = $soc_machine{'firmware'};
}
# sometimes has value like: 0000
- if (defined $arm_machine{'serial'}){
+ if (defined $soc_machine{'serial'}){
# most samples I've seen are like: 0000
- $arm_machine{'serial'} =~ s/^[0]+$//;
- $rows[$j]{main::key($num++,'serial')} = main::apply_filter($arm_machine{'serial'});
+ $soc_machine{'serial'} =~ s/^[0]+$//;
+ $rows[$j]{main::key($num++,'serial')} = main::apply_filter($soc_machine{'serial'});
}
eval $end if $b_log;
return @rows;
@@ -9253,48 +9339,58 @@ sub machine_data_sys {
# which will be used for alt ARM machine data in cases
# where no dmi data present, or by cpu data to guess at
# certain actions for arm only.
-sub machine_data_arm {
+sub machine_data_soc {
eval $end if $b_log;
- my (%arm_machine,@temp);
+ my (%soc_machine,@temp);
if (my $file = main::system_files('cpuinfo')){
#$file = "$ENV{'HOME'}/bin/scripts/inxi/data/cpu/arm/arm-shevaplug-1.2ghz.txt";
my @data = main::reader($file);
foreach (@data){
- if (/^Hardware/i){
+ if (/^(Hardware|machine)\s*:/i){
+ @temp = split /\s*:\s*/, $_;
+ $temp[1] = main::arm_cleaner($temp[1]);
+ $temp[1] = main::dmi_cleaner($temp[1]);
+ $soc_machine{'device'} = main::cleaner($temp[1]);
+ }
+ elsif (/^(system type)\s*:/i){
@temp = split /\s*:\s*/, $_;
- $arm_machine{'device'} = main::cleaner($temp[1]);
+ $temp[1] = main::dmi_cleaner($temp[1]);
+ $soc_machine{'model'} = main::cleaner($temp[1]);
}
elsif (/^Revision/i){
@temp = split /\s*:\s*/, $_;
- $arm_machine{'firmware'} = $temp[1];
+ $soc_machine{'firmware'} = $temp[1];
}
elsif (/^Serial/i){
@temp = split /\s*:\s*/, $_;
- $arm_machine{'serial'} = $temp[1];
+ $soc_machine{'serial'} = $temp[1];
}
}
}
- if (-f '/proc/device-tree/model'){
+ if (!$soc_machine{'model'} && -f '/proc/device-tree/model'){
my $model = (main::reader('/proc/device-tree/model'))[0];
main::log_data('data',"device-tree-model: $model") if $b_log;
if ( $model ){
$model = main::dmi_cleaner($model);
+ $model = (split /\x01|\x02|\x03|\x00/, $model)[0] if $model;
# idea was to use only first part of string, but now try using all
#my (@result) = ();
- #@result = split(/\s+/, $arm_machine{'device'}) if $arm_machine{'device'};
- if ( !$arm_machine{'device'} || ($model && $model !~ /$arm_machine{'device'}/i) ){
- $arm_machine{'model'} = $model;
+ #@result = split(/\s+/, $soc_machine{'device'}) if $soc_machine{'device'};
+ if ( !$soc_machine{'device'} || ($model && $model !~ /$soc_machine{'device'}/i) ){
+ $model = main::arm_cleaner($model);
+ $soc_machine{'model'} = $model;
}
}
}
- if (!$arm_machine{'serial'} && -f '/proc/device-tree/serial-number'){
+ if (!$soc_machine{'serial'} && -f '/proc/device-tree/serial-number'){
my $serial = (main::reader('/proc/device-tree/serial-number'))[0];
+ $serial = (split /\x01|\x02|\x03|\x00/, $serial)[0] if $serial;
main::log_data('data',"device-tree-serial: $serial") if $b_log;
- $arm_machine{'serial'} = $serial if $serial;
+ $soc_machine{'serial'} = $serial if $serial;
}
- #print Data::Dumper::Dumper \%arm_machine;
+ #print Data::Dumper::Dumper \%soc_machine;
eval $end if $b_log;
- return %arm_machine;
+ return %soc_machine;
}
# bios_date: 09/07/2010
@@ -9595,12 +9691,9 @@ sub get {
eval $start if $b_log;
my (@data,@rows);
my $num = 0;
- if ($b_arm && !$b_arm_net && !$b_pci_tool){
- my $key = 'ARM';
- @data = ({
- main::key($num++,$key) => main::row_defaults('arm-pci',''),
- },);
- @rows = (@rows,@data);
+ if (($b_arm || $b_mips) && !$b_soc_net && !$b_pci_tool){
+ # do nothing, but keep the test conditions to force
+ # the non arm case to always run
}
else {
@data = card_data();
@@ -9608,6 +9701,14 @@ sub get {
}
@data = usb_data();
@rows = (@rows,@data) if @data;
+ # note: rasberry pi uses usb networking only
+ if (!@rows && ($b_arm || $b_mips)){
+ my $key = ($b_arm) ? 'ARM' : 'MIPS';
+ @data = ({
+ main::key($num++,$key) => main::row_defaults(lc($key) . '-pci',''),
+ },);
+ @rows = (@rows,@data);
+ }
if ($show{'network-advanced'}){
# @ifs_found = ();
# shift @ifs_found;
@@ -9649,7 +9750,7 @@ sub card_data {
#print "$row[0] $row[3]\n";
# NOTE: class 06 subclass 80
# https://www-s.acm.illinois.edu/sigops/2007/roll_your_own/7.c.1.html
- if ($row[0] eq 'network' || $row[0] eq 'ethernet' || $row[1] eq '0680' ){
+ if (($row[0] && $row[0] =~ /^(eth|ethernet|ethernet-phy|network|wifi|wlan)$/ )|| ($row[1] && $row[1] eq '0680' ) ){
#print "$row[0] $row[3]\n";
$j = scalar @rows;
my $driver = $row[9];
@@ -9669,9 +9770,16 @@ sub card_data {
$driver ||= 'N/A';
@data = ({
main::key($num++,'Card') => $card,
- main::key($num++,'driver') => $driver,
},);
@rows = (@rows,@data);
+ #if ($extra > 2 && $b_pci_tool && $row[11]){
+ # my $item = main::get_pci_vendor($row[4],$row[11]);
+ # $rows[$j]{main::key($num++,'model')} = $item if $item;
+ #}
+ if ($row[1] eq '0680'){
+ $rows[$j]{main::key($num++,'type')} = 'network bridge';
+ }
+ $rows[$j]{main::key($num++,'driver')} = $driver;
if ($extra > 0){
if ($row[9] && !$bsd_type){
my $version = main::get_module_version($row[9]);
@@ -9681,7 +9789,12 @@ sub card_data {
$row[8] ||= 'N/A';
# as far as I know, wifi has no port, but in case it does in future, use it
$rows[$j]{main::key($num++,'port')} = $row[8] if (!$b_wifi || ( $b_wifi && $row[8] ne 'N/A') );
- $rows[$j]{main::key($num++,'bus ID')} = (!$row[2] && !$row[3]) ? 'N/A' : "$row[2].$row[3]";
+ my $bus_id = 'N/A';
+ # note: for arm/mips we want to see the single item bus id, why not?
+ if ($row[2] && $row[3]){$bus_id = "$row[2].$row[3]"}
+ elsif ($row[2]){$bus_id = $row[2]}
+ elsif ($row[3]){$bus_id = $row[3]}
+ $rows[$j]{main::key($num++,'bus ID')} = $bus_id;
}
if ($extra > 1){
$rows[$j]{main::key($num++,'chip ID')} = $chip_id;
@@ -9699,7 +9812,8 @@ sub card_data {
#print "$row[0]\n";
}
# @rows = ();
- if (!@rows){
+ # we want to handle ARM errors in main get
+ if (!@rows && !$b_arm){
my $key = 'Message';
@data = ({
main::key($num++,$key) => main::row_defaults('pci-card-data',''),
@@ -9785,7 +9899,6 @@ sub usb_data {
if ($extra > 1){
$rows[$j]{main::key($num++,'chip ID')} = $row[2];
}
- $j = scalar @rows;
if ($show{'network-advanced'}){
if (!$bsd_type){
my (@temp,$vendor,$chip);
@@ -9801,6 +9914,7 @@ sub usb_data {
#}
@rows = (@rows,@data) if @data;
}
+ $j = scalar @rows;
}
}
}
@@ -10597,13 +10711,14 @@ sub partition_data {
$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 $bsd_type ne 'darwin';
- if (my $path = main::check_program('mount')){
- @mount = main::grabber("$path 2>/dev/null");
- }
+ }
+ # busybox only supports -k and -P, openbsd, darwin
+ if (!@partitions_working){
+ @partitions_working = main::grabber("df -k 2>/dev/null");
+ $b_fs = 0;
+ $cols = 5 if !$bsd_type || $bsd_type ne 'darwin';
+ if (my $path = main::check_program('mount')){
+ @mount = main::grabber("$path 2>/dev/null");
}
}
# determine positions
@@ -10675,7 +10790,12 @@ sub partition_data {
}
if ($b_load){
if (!$bsd_type){
- $fs = (%part && $part{'fs'}) ? $part{'fs'} : $row[1];
+ if ($b_fs){
+ $fs = (%part && $part{'fs'}) ? $part{'fs'} : $row[1];
+ }
+ else {
+ $fs = get_mounts_fs($row[0],@mount);
+ }
if ($show{'label'}) {
if (%part && $part{'label'}) {
$label = $part{'label'};
@@ -10694,7 +10814,7 @@ sub partition_data {
}
}
else {
- $fs = ($b_fs) ? $row[1]: get_bsd_fs($row[0],@mount);
+ $fs = ($b_fs) ? $row[1]: get_mounts_fs($row[0],@mount);
if (@gpart && ($show{'label'} || $show{'uuid'} ) ){
my @extra = get_bsd_label_uuid("$dev_base");
if (@extra){
@@ -10755,7 +10875,7 @@ sub swap_data {
# though this can include /dev/ramzswap0. Note: you can also use /proc/swaps for this
# data, it's the same exact output as swapon -s
foreach (@working){
- next if ! /^\/dev/;
+ next if ! /^\/dev/ || /^\/dev\/(ramzwap|zram)/;
my @data = split /\s+/, $_;
my $dev_base = $data[0];
$dev_base =~ s/^\/dev\///;
@@ -10792,16 +10912,21 @@ sub swap_data {
eval $end if $b_log;
return @swap;
}
-sub get_bsd_fs {
+sub get_mounts_fs {
eval $start if $b_log;
my ($item,@mount) = @_;
- $item =~ s/map:\/(\S+)/map $1/ if $bsd_type eq 'darwin';
+ $item =~ s/map:\/(\S+)/map $1/ if $bsd_type && $bsd_type eq 'darwin';
return 'N/A' if ! @mount;
my ($fs) = ('');
# linux: /dev/sdb6 on /var/www/m type ext4 (rw,relatime,data=ordered)
+ # /dev/sda3 on /root.dev/ugw type ext3 (rw,relatime,errors=continue,user_xattr,acl,barrier=1,data=journal)
# bsd: /dev/ada0s1a on / (ufs, local, soft-updates)
foreach (@mount){
- if ($_ =~ /^$item\son.*\(([^,\s\)]+)[,\s]*.*\)/){
+ if ($bsd_type && $_ =~ /^$item\son.*\(([^,\s\)]+)[,\s]*.*\)/){
+ $fs = $1;
+ last;
+ }
+ elsif (!$bsd_type && $_ =~ /^$item\son.*\stype\s([\S]+)\s\([^\)]+\)/){
$fs = $1;
last;
}
@@ -10950,8 +11075,8 @@ sub get_root {
my $temp = Cwd::abs_path($path);
$path = $temp if $temp;
# note: it's a kernel config option to have /dev/root be a sym link
- # or not, if it isn't, path will be empty, if so, then try mount
- if (!$path && (my $program = main::check_program('mount'))){
+ # or not, if it isn't, path will remain /dev/root, if so, then try mount
+ if ($path eq '/dev/root' && (my $program = main::check_program('mount'))){
my @data = main::grabber("$program 2>/dev/null");
# /dev/sda2 on / type ext4 (rw,noatime,data=ordered)
foreach (@data){
@@ -11175,10 +11300,11 @@ sub create_output {
my $driver = ($row{'driver'}) ? $row{'driver'}: 'N/A';
@data = ({
main::key($num++,'Hardware') => $device,
- main::key($num++,'driver') => $driver,
});
@rows = (@rows,@data);
$j = scalar @rows - 1;
+ $rows[$j]{main::key($num++,'vendor')} = $row{'vendor'} if $row{'vendor'};
+ $rows[$j]{main::key($num++,'driver')} = $driver;
if ($extra > 0){
my $driver_version = ($row{'driver-version'}) ? $row{'driver-version'}: 'N/A' ;
$rows[$j]{main::key($num++,'v')} = $driver_version;
@@ -11417,13 +11543,16 @@ sub raid_data {
# 10 modules
sub hardware_raid {
eval $start if $b_log;
- my ($driver,@data,@working);
+ my ($driver,$vendor,@data,@working);
foreach my $ref (@pci){
@working = @$ref;
next if $working[1] ne '0104';
$driver = ($working[9]) ? lc($working[9]): '';
$driver =~ s/-/_/g if $driver;
my $driver_version = ($driver) ? main::get_module_version($driver): '';
+ if ($extra > 2 && $b_pci_tool && $working[11]){
+ $vendor = main::get_pci_vendor($working[4],$working[11]);
+ }
@data = ({
'bus-id' => $working[2],
'chip-id' => $working[6],
@@ -11434,6 +11563,7 @@ sub hardware_raid {
'rev' => $working[7],
'sub-id' => $working[3],
'vendor-id' => $working[5],
+ 'vendor' => $vendor,
});
@hardware_raid = (@hardware_raid,@data);
}
@@ -12327,7 +12457,8 @@ sub get_repos_linux {
push @files, $apt;
main::log_data('data',"apt repo files:\n" . main::joiner(\@files, "\n", 'unset') ) if $b_log;
foreach ( sort @files){
- @data = repo_builder($_,'apt','^\s*deb') if -r $_;
+ # altlinux uses rpms in apt files!
+ @data = repo_builder($_,'apt','^\s*(deb|rpm)') if -r $_;
@rows = (@rows,@data);
}
#@files = main::globber("$ENV{'HOME'}/bin/scripts/inxi/data/repo/apt/*.sources");
@@ -13010,7 +13141,7 @@ sub get {
@rows = (@rows,@data);
}
else {
- %sensors = sensors_data();
+ %sensors = lm_sensors_data();
@data = create_output($source,%sensors);
#print "here 2\n";
if (!@data) {
@@ -13063,6 +13194,10 @@ sub create_output {
my $psu_temp = $sensors{'psu-temp'} . $temp_unit;
$rows[$j]{main::key($num++,'psu')} = $psu_temp;
}
+ if (defined $sensors{'ambient-temp'}){
+ my $ambient_temp = $sensors{'ambient-temp'} . $temp_unit;
+ $rows[$j]{main::key($num++,'ambient')} = $ambient_temp;
+ }
if (scalar @gpu == 1){
my $gpu_temp = $gpu[0]{'temp'};
my $gpu_type = $gpu[0]{'type'};
@@ -13109,6 +13244,9 @@ sub create_output {
$rows[$j]{main::key($num++,"fan-$i")} = $fan_default[$i];
}
}
+ $rows[$j]{main::key($num++,'psu')} = $sensors{'fan-psu'} if defined $sensors{'fan-psu'};
+ $rows[$j]{main::key($num++,'psu-1')} = $sensors{'fan-psu1'} if defined $sensors{'fan-psu1'};
+ $rows[$j]{main::key($num++,'psu-2')} = $sensors{'fan-psu2'} if defined $sensors{'fan-psu2'};
# note: so far, only nvidia-settings returns speed, and that's in percent
if (scalar @gpu == 1 && defined $gpu[0]{'fan-speed'}){
my $gpu_fan = $gpu[0]{'fan-speed'} . $gpu[0]{'speed-unit'};
@@ -13165,7 +13303,7 @@ sub ipmi_data {
my ($program) = @_;
my ($b_cpu_0,$cmd,$file,@data,$fan_working,%sensors,@row,$sys_fan_nu,
$temp_working,$working_unit);
- $program ||= 'ipmi-xx'; # only for debugging, will always exist if reaches here
+ $program ||= 'ipmi-sensors'; # only for debugging, will always exist if reaches here
my ($b_ipmitool,$i_key,$i_value,$i_unit);
if ($program =~ /ipmi-sensors$/){
$cmd = $program;
@@ -13180,30 +13318,39 @@ sub ipmi_data {
#$file = "$ENV{'HOME'}/bin/scripts/inxi/data/ipmitool/ipmitool-sensors-crazy-epyc-1.txt";
#$file = "$ENV{'HOME'}/bin/scripts/inxi/data/ipmitool/ipmi-sensors-crazy-epyc-1.txt";$program='ipmi-sensors';
#$file = "$ENV{'HOME'}/bin/scripts/inxi/data/ipmitool/ipmitool-sensors-RK016013.txt";$program='ipmi-sensors';
+ #$file = "$ENV{'HOME'}/bin/scripts/inxi/data/ipmitool/ipmi-sensors-lathander.txt";
+ #$file = "$ENV{'HOME'}/bin/scripts/inxi/data/ipmitool/ipmi-sensors-zwerg.txt";
#@data = main::reader($file);
return if ! @data;
foreach (@data){
next if /^\s*$/;
- #print "$_\n";
+ # print "$_\n";
@row = split /\s*\|\s*/, $_;
- # print "$row[$i_key] $row[$i_value]\n";
- if ($row[$i_key] =~ /^System[\s_]Temp/i){
+ next if $row[$i_value] !~ /^[0-9\.]+$/i;
+ # print "$row[$i_key] - $row[$i_value]\n";
+ if ($row[$i_key] =~ /^(System[\s_]Temp|System[\s_]?Board)$/i){
$sensors{'mobo-temp'} = int($row[$i_value]);
$working_unit = $row[$i_unit];
$working_unit =~ s/degrees\s// if $b_ipmitool;
$sensors{'temp-unit'} = set_temp_unit($sensors{'temp-unit'},$working_unit) if $working_unit;
}
+ elsif ($row[$i_key] =~ /^(Ambient)$/i){
+ $sensors{'ambient-temp'} = int($row[$i_value]);
+ $working_unit = $row[$i_unit];
+ $working_unit =~ s/degrees\s// if $b_ipmitool;
+ $sensors{'temp-unit'} = set_temp_unit($sensors{'temp-unit'},$working_unit) if $working_unit;
+ }
# Platform Control Hub (PCH), it is the X370 chip on the Crosshair VI Hero.
# VRM: voltage regulator module
- # NOTE: CPU0_TEMP CPU1_TEMP is possible, unfortunately
- elsif ( !$sensors{'cpu-temp'} && $row[$i_key] =~ /^CPU([01])?[\s_]Temp/i) {
+ # NOTE: CPU0_TEMP CPU1_TEMP is possible, unfortunately; CPU Temp Interf
+ elsif ( !$sensors{'cpu-temp'} && $row[$i_key] =~ /^CPU([01])?([\s_]Temp)?$/i) {
$b_cpu_0 = 1 if defined $1 && $1 == 0;
$sensors{'cpu-temp'} = int($row[$i_value]);
$working_unit = $row[$i_unit];
$working_unit =~ s/degrees\s// if $b_ipmitool;
$sensors{'temp-unit'} = set_temp_unit($sensors{'temp-unit'},$working_unit) if $working_unit;
}
- elsif ($row[$i_key] =~ /^CPU([1-4])[\s_]Temp/i) {
+ elsif ($row[$i_key] =~ /^CPU([1-4])([\s_]Temp)?$/i) {
$temp_working = $1;
$temp_working++ if $b_cpu_0;
$sensors{"cpu${temp_working}-temp"} = int($row[$i_value]);
@@ -13240,6 +13387,12 @@ sub ipmi_data {
}
$sensors{'temp-unit'} = set_temp_unit($sensors{'temp-unit'},$working_unit) if $working_unit;
}
+ elsif (!$sensors{'sodimm-temp'} && $row[$i_key] =~ /^(DIMM-[0-9][A-Z]?)$/i){
+ $sensors{'sodimm-temp'} = int($row[$i_value]);
+ $working_unit = $row[$i_unit];
+ $working_unit =~ s/degrees\s// if $b_ipmitool;
+ $sensors{'temp-unit'} = set_temp_unit($sensors{'temp-unit'},$working_unit) if $working_unit;
+ }
# note: can be cpu fan:, cpu fan speed:, etc.
elsif ($row[$i_key] =~ /^(CPU|Processor)[\s_]Fan/i) {
$sensors{'fan-main'} = () if !$sensors{'fan-main'};
@@ -13248,7 +13401,7 @@ sub ipmi_data {
# note that the counters are dynamically set for fan numbers here
# otherwise you could overwrite eg aux fan2 with case fan2 in theory
# note: cpu/mobo/ps are 1/2/3
- elsif ($row[$i_key] =~ /^(SYS[\s_])?FAN([0-9A-F]+)/i) {
+ elsif ($row[$i_key] =~ /^(SYS[\s_])?FAN[\s_]?([0-9A-F]+)/i) {
$sys_fan_nu = hex($2);
next if $row[$i_value] !~ /^[0-9\.]+$/;
$fan_working = int($row[$i_value]);
@@ -13265,24 +13418,33 @@ sub ipmi_data {
}
}
}
+ elsif ($row[$i_key] =~ /^(FAN PSU|PSU FAN)$/i) {
+ $sensors{'fan-psu'} = int($row[$i_value]);
+ }
+ elsif ($row[$i_key] =~ /^(FAN PSU1|PSU1 FAN)$/i) {
+ $sensors{'fan-psu-1'} = int($row[$i_value]);
+ }
+ elsif ($row[$i_key] =~ /^(FAN PSU2|PSU2 FAN)$/i) {
+ $sensors{'fan-psu-2'} = int($row[$i_value]);
+ }
if ($extra > 0){
- if ($row[$i_key] =~ /^(P[_]?)?12V$/i) {
+ if ($row[$i_key] =~ /^(MAIN\s|P[_]?)?12V$/i) {
$sensors{'volts-12'} = $row[$i_value];
}
- elsif ($row[$i_key] =~ /^(P5V|5VCC)$/i) {
+ elsif ($row[$i_key] =~ /^(MAIN\s5V|P5V|5VCC|5V PG)$/i) {
$sensors{'volts-5'} = $row[$i_value];
}
- elsif ($row[$i_key] =~ /^(P3V3|3.3VCC)$/i) {
+ elsif ($row[$i_key] =~ /^(MAIN\s3.3V|P3V3|3.3VCC|3.3V PG)$/i) {
$sensors{'volts-3.3'} = $row[$i_value];
}
- elsif ($row[$i_key] =~ /^(P_)?VBAT$/i) {
+ elsif ($row[$i_key] =~ /^((P_)?VBAT|CMOS Battery|BATT 3.0V)$/i) {
$sensors{'volts-vbat'} = $row[$i_value];
}
# NOTE: VDimmP1ABC VDimmP1DEF
- elsif (!$sensors{'volts-dimm-p1'} && $row[$i_key] =~ /^(P1_VMEM|VDimmP1)/i) {
+ elsif (!$sensors{'volts-dimm-p1'} && $row[$i_key] =~ /^(P1_VMEM|VDimmP1|MEM RSR A PG)/i) {
$sensors{'volts-dimm-p1'} = $row[$i_value];
}
- elsif (! $sensors{'volts-dimm-p2'} && $row[$i_key] =~ /^(P2_VMEM|VDimmP2)/i) {
+ elsif (! $sensors{'volts-dimm-p2'} && $row[$i_key] =~ /^(P2_VMEM|VDimmP2|MEM RSR B PG)/i) {
$sensors{'volts-dimm-p2'} = $row[$i_value];
}
elsif (!$sensors{'volts-soc-p1'} && $row[$i_key] =~ /^(P1_SOC_RUN$)/i) {
@@ -13300,27 +13462,28 @@ sub ipmi_data {
# print Data::Dumper::Dumper \%sensors;
return %sensors;
}
-sub sensors_data {
+sub lm_sensors_data {
eval $start if $b_log;
my (%sensors);
my ($b_valid,$sys_fan_nu) = (0,0);
my ($adapter,$fan_working,$temp_working,$working_unit) = ('','','','');
+ @sensors_data = main::grabber(main::check_program('sensors') . " 2>/dev/null");
#my $file = "$ENV{'HOME'}/bin/scripts/inxi/data/sensors/amdgpu-w-fan-speed-stretch-k10.txt";
#my $file = "$ENV{'HOME'}/bin/scripts/inxi/data/sensors/peci-tin-geggo.txt";
#my $file = "$ENV{'HOME'}/bin/scripts/inxi/data/sensors/sensors-w-other-biker.txt";
#my $file = "$ENV{'HOME'}/bin/scripts/inxi/data/sensors/sensors-asus-chassis-1.txt";
+ #my $file = "$ENV{'HOME'}/bin/scripts/inxi/data/sensors/sensors-devnull-1.txt";
#@sensors_data = main::reader($file);
- @sensors_data = main::grabber(main::check_program('sensors') . " 2>/dev/null");
#print @sensors_data;
@sensors_data = map {$_ =~ s/\s*:\s*\+?/:/;$_} @sensors_data;
foreach (@sensors_data){
# we get this from gpu_data()
- if (/^(amdgpu|intel|nouveau|radeon)-pci/){
+ if (/^(amdgpu|intel|nouveau|radeon|.*hwmon)-pci/){
$b_valid = 0;
$adapter = '';
next;
}
- if (/^(?:(?!amdgpu|intel|nouveau|radeon).)*-(isa|pci|virtual)-/){
+ if (/^(?:(?!amdgpu|intel|nouveau|radeon|.*hwmon).)*-(isa|pci|virtual)-/){
$b_valid = 1;
$adapter = $1;
next;
@@ -13710,13 +13873,18 @@ sub data_processor {
%sensors = ();
}
else {
- 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);
+ my ($ambient_temp,$psu_fan,$psu1_fan,$psu2_fan,$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]
$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'};
+ $ambient_temp = $sensors{'ambient-temp'} if $sensors{'ambient-temp'};
+ $psu_fan = $sensors{'fan-psu'} if $sensors{'fan-psu'};
+ $psu1_fan = $sensors{'fan-psu-1'} if $sensors{'fan-psu-1'};
+ $psu2_fan = $sensors{'fan-psu-2'} if $sensors{'fan-psu-2'};
# so far only for ipmi, sensors data is junk for volts
if ($extra > 0 &&
($sensors{'volts-12'} || $sensors{'volts-5'} || $sensors{'volts-3.3'} || $sensors{'volts-vbat'}) ){
@@ -13730,6 +13898,7 @@ sub data_processor {
$v_soc_p2 = $sensors{'volts-soc-p2'} if $sensors{'volts-soc-p2'};
}
%sensors = (
+ 'ambient-temp' => $ambient_temp,
'cpu-temp' => $cpu_temp,
'cpu2-temp' => $cpu2_temp,
'cpu3-temp' => $cpu3_temp,
@@ -13739,6 +13908,9 @@ sub data_processor {
'temp-unit' => $sensors{'temp-unit'},
'fan-main' => \@fan_main,
'fan-default' => \@fan_default,
+ 'fan-psu' => $psu_fan,
+ 'fan-psu1' => $psu1_fan,
+ 'fan-psu2' => $psu2_fan,
);
if ($psu_temp){
$sensors{'psu-temp'} = $psu_temp;
@@ -13857,6 +14029,10 @@ sub gpu_data {
$holder = $1;
$j = scalar @gpudata;
}
+ if (/^(?:(?!amdgpu|.*hwmon|intel|nouveau|radeon).)*-(pci|virtual|isa)-(.*)/){
+ $b_found = 0;
+ $holder = '';
+ }
if ($b_found){
if (/^temp.*:([0-9]+).*(C|F)/){
$gpudata[$j]{'temp'} = $1;
@@ -13870,10 +14046,6 @@ sub gpu_data {
}
main::log_data('dump','sensors output: video: @gpudata',\@gpudata);
}
- if (/^(?:(?!amdgpu|intel|nouveau|radeon).)*-(pci|virtual|isa)-(.*)/){
- $b_found = 0;
- $holder = '';
- }
}
}
# we'll probably use this data elsewhere so make it a one time call
@@ -14067,7 +14239,7 @@ sub unmounted_data {
# need to exclude loop type file systems, squashfs for example
# NOTE: nvme needs special treatment because the main device is: nvme0n1
# note: $working[2] != 1 is wrong, it's not related
- if ( $working[-1] !~ /^(nvme[0-9]+n|mmcblk)[0-9]+$/ &&
+ if ( $working[-1] !~ /^(nvme[0-9]+n|mmcblk|mtdblk|mtdblock)[0-9]+$/ &&
$working[-1] =~ /[a-z][0-9]+$|dm-[0-9]+$/ && $working[-1] !~ /loop/ &&
!(grep {$working[-1] =~ /$_/} @mounted)){
%part = PartitionData::check_lsblk($working[-1],0) if (@lsblk && $working[-1]);
@@ -14881,12 +15053,14 @@ sub get_compiler_version_linux {
# 3 - toolkit version
# 4 - info extra desktop data
# 5 - wm
+# 6 - wm version
{
package DesktopEnvironment;
-my ($b_xprop,$kde_session_version,$xdg_desktop,@desktop,@data,@xprop);
+my ($b_xprop,$desktop_session,$kde_session_version,$xdg_desktop,@desktop,@data,@xprop);
sub get {
# NOTE $XDG_CURRENT_DESKTOP envvar is not reliable, but it shows certain desktops better.
# most desktops are not using it as of 2014-01-13 (KDE, UNITY, LXDE. Not Gnome)
+ $desktop_session = ( $ENV{'DESKTOP_SESSION'} ) ? lc($ENV{'DESKTOP_SESSION'}) : '';
$xdg_desktop = ( $ENV{'XDG_CURRENT_DESKTOP'} ) ? lc($ENV{'XDG_CURRENT_DESKTOP'}) : '';
$kde_session_version = ($ENV{'KDE_SESSION_VERSION'}) ? $ENV{'KDE_SESSION_VERSION'} : '';
get_kde_data();
@@ -14905,7 +15079,7 @@ sub get {
if ($extra > 2 && @desktop){
set_info_data();
}
- if ($b_display && !$b_force_display && $extra > 2){
+ if ($b_display && !$b_force_display && $extra > 1){
get_wm();
}
main::log_data('dump','@desktop', \@desktop) if $b_log;
@@ -14958,9 +15132,19 @@ sub get_kde_data {
$desktop[1] = ($kde_session_version) ? $kde_session_version: main::row_defaults('unknown-desktop-version');
}
# print Data::Dumper::Dumper \@version_data;
- if ($extra > 0 && @version_data){
+ if ($extra > 1){
+ if (@version_data){
+ $desktop[3] = main::awk(\@version_data,'^Qt:', 2,'\s+');
+ }
+ # qmake can have variants, qt4-qmake, qt5-qmake, also qt5-default but not tested
+ if (!$desktop[3] && ($program = main::check_program("qmake"))){
+ # note: this program has issues, it may appear to be in /usr/bin, but it
+ # often fails to execute, so the below will have null output, but use as a
+ # fall back test anyway.
+ @version_data = main::grabber("$program --version 2>/dev/null");
+ $desktop[3] = main::awk(\@version_data,'^Using Qt version',4) if @version_data;
+ }
$desktop[2] = 'Qt';
- $desktop[3] = main::awk(\@version_data,'^Qt:', 2,'\s+');
}
}
# KDE_FULL_SESSION property is only available since KDE 3.5.5.
@@ -14971,7 +15155,7 @@ sub get_kde_data {
if (!$desktop[1]){
$desktop[1] = '3.5';
}
- if ($extra > 0 && @version_data){
+ if ($extra > 1 && @version_data){
$desktop[2] = 'Qt';
$desktop[3] = main::awk(\@version_data,'^Qt:',2,'\s+') if @version_data;
}
@@ -14981,36 +15165,54 @@ sub get_kde_data {
sub get_env_de_data {
eval $start if $b_log;
my ($program,@version_data);
-
- if ($xdg_desktop eq 'unity'){
+ main::set_ps_gui() if ! $b_ps_gui;
+ if ($desktop_session eq 'trinity' || $xdg_desktop eq 'trinity' || (grep {/^tde/} @ps_gui) ){
+ $desktop[0] = 'Trinity';
+ if ($program = main::check_program('kdesktop')){
+ @version_data = main::grabber("$program --version 2>/dev/null");
+ $desktop[1] = main::awk(\@version_data,'^TDE:',2,'\s+') if @version_data;
+ }
+ if ($extra > 1 && @version_data){
+ $desktop[2] = 'Qt';
+ $desktop[3] = main::awk(\@version_data,'^Qt:',2,'\s+') if @version_data;
+ }
+ }
+ elsif ($xdg_desktop eq 'unity'){
@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],$data[6]);
- set_gtk_data() if $extra > 0;
+ #set_gtk_data() if $extra > 1;
}
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],$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],$data[6]);
- if ( $extra > 0 ){
- if ($program = main::check_program("kded$kde_session_version") ){
- @version_data = main::grabber("$program --version 2>/dev/null");
- $desktop[2] = 'Qt';
- $desktop[3] = main::awk(\@version_data,'^Qt:',2);
+ # debian package: lxde-core.
+ # NOTE: some distros fail to set XDG data for root
+ elsif ( $xdg_desktop =~ /^(lxde|razor|lxqt)$/ || (grep {/^(razor-session|lxsession|lxqt-session)$/} @ps_gui)){
+ # note: openbox-lxde --version may be present, but returns openbox data
+ if ($xdg_desktop eq 'lxde' || (grep {/^lxsession$/} @ps_gui )){
+ @data = main::program_values('lxde');
+ $desktop[0] = $data[3];
+ $desktop[1] = main::program_version('lxpanel',$data[0],$data[1],$data[2],$data[5],$data[6]);
+ }
+ # NOTE: lxqt-about opens a gui dialog
+ elsif ($xdg_desktop eq 'razor' || $xdg_desktop eq 'lxqt' || (grep {/^(razor-desktop|lxqt-session)$/} @ps_gui)) {
+ if (grep {/^lxqt-session$/} @ps_gui){
+ @data = main::program_values('lxqt');
+ $desktop[0] = $data[3];
+ # BAD: lxqt-about opens dialogue, sigh
+ $desktop[1] = main::program_version('lxqt-panel',$data[0],$data[1],$data[2],$data[5],$data[6]);
}
- 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],$data[6]);
- $desktop[2] = $data[3];
+ elsif (grep {/^razor-session$/} @ps_gui){
+ $desktop[0] = 'Razor-Qt';
+ }
+ else {
+ $desktop[0] = 'LX-Qt-Variant';
}
+ set_qt_data() if $extra > 1;
}
}
# note, X-Cinnamon value strikes me as highly likely to change, so just
@@ -15019,7 +15221,13 @@ sub get_env_de_data {
@data = main::program_values('cinnamon');
$desktop[0] = $data[3];
$desktop[1] = main::program_version('cinnamon',$data[0],$data[1],$data[2],$data[5],$data[6]);
- set_gtk_data() if $extra > 0;
+ #set_gtk_data() if $extra > 1;
+ }
+ elsif ($xdg_desktop eq 'pantheon' || $desktop_session eq 'pantheon'){
+ @data = main::program_values('pantheon');
+ $desktop[0] = $data[3];
+ #$desktop[1] = main::program_version('pantheon',$data[0],$data[1],$data[2],$data[5],$data[6]);
+ #set_gtk_data() if $extra > 1;
}
eval $end if $b_log;
}
@@ -15038,7 +15246,7 @@ sub get_env_xprop_de_data {
@data = main::program_values('cinnamon');
$desktop[0] = $data[3];
$desktop[1] = main::program_version('cinnamon',$data[0],$data[1],$data[2],$data[5],$data[6]);
- set_gtk_data() if $extra > 0;
+ #set_gtk_data() if $extra > 1;
$desktop[0] ||= 'Cinnamon';
}
elsif ($xdg_desktop eq 'mate' || ( $b_xprop && main::awk(\@xprop,'_marco') )){
@@ -15046,15 +15254,12 @@ sub get_env_xprop_de_data {
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($program,$data[0],$data[1],$data[2],$data[5],$data[6]);
}
- set_gtk_data() if $extra > 0;
+ #set_gtk_data() if $extra > 1;
$desktop[0] ||= 'MATE';
}
# note, GNOME_DESKTOP_SESSION_ID is deprecated so we'll see how that works out
@@ -15070,7 +15275,7 @@ sub get_env_xprop_de_data {
@data = main::program_values('gnome-shell');
$desktop[1] = main::program_version('gnome-shell',$data[0],$data[1],$data[2],$data[5],$data[6]);
}
- set_gtk_data() if $extra > 0;
+ # set_gtk_data() if $extra > 1;
$desktop[0] = ( $data[3] ) ? $data[3] : 'Gnome';
}
eval $end if $b_log;
@@ -15081,7 +15286,12 @@ sub get_xprop_de_data {
#print join "\n", @xprop, "\n";
# String: "This is xfdesktop version 4.2.12"
# alternate: xfce4-about --version > xfce4-about 4.10.0 (Xfce 4.10)
- if ($xdg_desktop eq 'xfce' || main::awk(\@xprop,'xfce' )){
+ # note: some distros/wm (e.g. bunsen) set xdg to xfce to solve some other
+ # issues so don't test for that. $xdg_desktop eq 'xfce'
+ # the sequence here matters, some desktops like icewm, razor, let you set different
+ # wm, so we want to get the main controlling desktop first, then fall back to the wm
+ # detections. get_wm() will handle alternate wm detections.
+ if ((main::check_program('xfdesktop')) && main::awk(\@xprop,'^(xfdesktop|xfce)' )){
# this is a very expensive test that doesn't usually result in a find
# talk to xfce to see what id they will be using for xfce 5
# if (main::awk(\@xprop, 'xfce4')){
@@ -15111,56 +15321,13 @@ sub get_xprop_de_data {
}
$desktop[0] ||= 'Xfce';
$desktop[1] ||= ''; # xfce isn't going to be 4 forever
- if ($extra > 0){
+ if ($extra > 1){
@data = main::program_values('xfdesktop-toolkit');
#$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];
}
}
- elsif ( (main::check_program('blackbox') || main::check_program('fluxbox')) && main::awk(\@xprop,'blackbox_pid' )){
- 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],$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],$data[6]);
- }
- }
- # debian package: lxde-core
- elsif ( (main::check_program('lxpanel') || main::check_program('lxqt-session') ||
- 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],$data[6]);
- if ($xdg_desktop eq 'lxde' || main::awk(\@ps_cmd, 'lxsession')){
- $desktop[1] = "(Openbox $desktop[1])" if $desktop[1];
- $desktop[0] = 'LXDE';
- }
- elsif ($xdg_desktop eq 'razor' || $xdg_desktop eq 'lxqt' || main::awk(\@ps_cmd, 'razor-desktop|lxqt-session')) {
- if (main::awk(\@ps_cmd,'lxqt-session' )){
- $desktop[0] = 'LXQt';
- }
- elsif (main::awk(\@ps_cmd, 'razor-desktop')){
- $desktop[0] = 'Razor-Qt';
- }
- else {
- $desktop[0] = 'LX-Qt-Variant';
- }
- $desktop[1] = "(Openbox $desktop[1])" if $desktop[1];
- }
- else {
- $desktop[0] = 'Openbox';
- }
- }
- 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],$data[6]);
- }
elsif (main::check_program('enlightenment') && main::awk(\@xprop,'enlightenment' )){
$desktop[0] = 'Enlightenment';
# no -v or --version but version is in xprop -root
@@ -15169,14 +15336,25 @@ sub get_xprop_de_data {
$desktop[1] = (split /"/, $desktop[1])[1] if $desktop[1];
$desktop[1] = (split /\s+/, $desktop[1])[1] if $desktop[1];
}
+ # must come right after xfce
+ 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],$data[6]);
+ }
# debian package: i3-wm
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],$data[6]);
}
+ elsif (main::check_program('mwm') && main::awk(\@xprop,'^_motif' )){
+ @data = main::program_values('mwm');
+ $desktop[0] = $data[3];
+ # $desktop[1] = main::program_version('mwm',$data[0],$data[1],$data[2],$data[5],$data[6]);
+ }
# debian package name: wmaker
- elsif (main::check_program('WindowMaker') && main::awk(\@xprop,'^windowmaker' )){
+ 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],$data[6]);
@@ -15191,114 +15369,208 @@ sub get_xprop_de_data {
$desktop[0] = $data[3];
$desktop[1] = main::program_version('herbstluftwm',$data[0],$data[1],$data[2],$data[5],$data[6]);
}
+ elsif ( (main::check_program('blackbox') || main::check_program('fluxbox')) && main::awk(\@xprop,'blackbox_pid' )){
+ if (@ps_gui && (grep {/^fluxbox$/} @ps_gui )){
+ @data = main::program_values('fluxbox');
+ $desktop[0] = $data[3];
+ $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],$data[6]);
+ }
+ }
elsif (main::check_program('openbox') && main::awk(\@xprop,'openbox_pid' )){
@data = main::program_values('openbox');
$desktop[0] = $data[3];
$desktop[1] = main::program_version('openbox',$data[0],$data[1],$data[2],$data[5],$data[6]);
}
+ elsif (main::check_program('amiwm') && main::awk(\@xprop,'amiwm' )){
+ @data = main::program_values('amiwm');
+ $desktop[0] = $data[3];
+ #$desktop[1] = main::program_version('openbox',$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;
}
sub get_ps_de_data {
eval $start if $b_log;
my ($program,@version_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],$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],$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],$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],$data[6]);
- }
- elsif (main::check_program('blackbox') && main::awk(\@ps_cmd,'blackbox' )){
- @data = main::program_values('blackbox');
- $desktop[0] = $data[3];
- $desktop[1] = main::program_version('blackbox',$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],$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],$data[6]);
- }
- elsif (main::check_program('twm') && main::awk(\@ps_cmd,'(\s|\/)twm' )){
- # no version
- $desktop[0] = 'Twm';
+ main::set_ps_gui() if !$b_ps_gui;
+ if (@ps_gui){
+ # 1 check program; 2 search; 3 values; 4 version; 5 -optional: print value
+ my @desktops =(
+ ['fluxbox','fluxbox','fluxbox','fluxbox'],
+ ['fvwm-crystal','fvwm-crystal','fvwm-crystal','fvwm'],
+ ['fvwm2','fvwm2','fvwm2','fvwm2'],
+ ['fvwm','fvwm','fvwm','fvwm'],
+ ['pekwm','pekwm','pekwm','pekwm'],
+ ['awesome','awesome','awesome','awesome'],
+ ['blackbox','blackbox','blackbox','blackbox'],
+ ['openbox','openbox','openbox','openbox'],
+ # not in debian apt
+ ['scrotwm','scrotwm','scrotwm','scrotwm'],
+ ['spectrwm','spectrwm','spectrwm','spectrwm'],
+ ['twm','twm','twm','twm'],
+ # note: built from source, but I assume it will show: /usr/bin/dwm
+ ['dwm','dwm','dwm','dwm'],
+ # not in debian apt, current is wmii, version 3
+ ['wmii2','wmii2','wmii2','wmii2'],
+ ['wmii','wmii','wmii','wmii'],
+ ['9wm','9wm','9wm','9wm'],
+ ['amiwm','amiwm','amiwm','amiwm'],
+ ['flwm','flwm','flwm','flwm'],
+ ['jwm','jwm','jwm','jwm'],
+ ['mwm','mwm','mwm','mwm'],
+ ['notion','notion','notion','notion'],
+ ['ratpoison','ratpoison','ratpoison','ratpoison'],
+ ['sawfish','sawfish','sawfish','sawfish'],
+ ['matchbox-window-manager','matchbox-window-manager',
+ 'matchbox-window-manager','matchbox-window-manager'],
+ ['afterstep','afterstep','afterstep','afterstep'],
+ ['WindowMaker','WindowMaker','wmaker','wmaker'],
+ ['windowlab','windowlab','windowlab','windowlab'],
+ ['xmonad','xmonad','xmonad','xmonad'],
+ );
+ foreach my $ref (@desktops){
+ my @item = @$ref;
+ # no need to use check program with short list of ps_gui
+ # if ( main::check_program($item[0]) && (grep {/^$item[1]$/} @ps_gui)){
+ if (grep {/^$item[1]$/} @ps_gui){
+ @data = main::program_values($item[2]);
+ $desktop[0] = $data[3];
+ if ($data[1] && $data[2]){
+ $desktop[1] = main::program_version($item[3],$data[0],$data[1],$data[2],$data[5],$data[6]);
+ }
+ last;
+ }
+ }
}
- # note: built from source, but I assume it will show: /usr/bin/dwm
- 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],$data[6]);
+ eval $end if $b_log;
+}
+
+sub set_qt_data {
+ eval $start if $b_log;
+ my ($program,@data,@version_data);
+ my $kde_version = $kde_session_version;
+ $program = '';
+ if (!$kde_version){
+ if ($program = main::check_program("kded6") ){$kde_version = 6;}
+ elsif ($program = main::check_program("kded5") ){$kde_version = 5;}
+ elsif ($program = main::check_program("kded4") ){$kde_version = 4;}
+ elsif ($program = main::check_program("kded") ){$kde_version = '';}
+ }
+ # alternate: qt4-default, qt4-qmake or qt5-default, qt5-qmake
+ if (!$desktop[3] && ($program = main::check_program("qmake"))){
+ @version_data = main::grabber("$program --version 2>/dev/null");
+ $desktop[2] = 'Qt';
+ $desktop[3] = main::awk(\@version_data,'^Using Qt version',4) if @version_data;
+ }
+ if (!$desktop[3] && ($program = main::check_program("qtdiag") )){
+ @data = main::program_values('qtdiag');
+ $desktop[3] = main::program_version($program,$data[0],$data[1],$data[2],$data[5],$data[6]);
+ $desktop[2] = $data[3];
+ }
+ if (!$desktop[3] && ($program = main::check_program("kf$kde_version-config") )){
+ @version_data = main::grabber("$program --version 2>/dev/null");
+ $desktop[2] = 'Qt';
+ $desktop[3] = main::awk(\@version_data,'^Qt:',2) if @version_data;
+ }
+ # note: qt 5 does not show qt version in kded5, sigh
+ if (!$desktop[3] && ($program = main::check_program("kded$kde_version"))){
+ @version_data = main::grabber("$program --version 2>/dev/null");
+ $desktop[2] = 'Qt';
+ $desktop[3] = main::awk(\@version_data,'^Qt:',2) if @version_data;
}
- # 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],$data[6]);
+ eval $end if $b_log;
+}
+
+sub get_wm {
+ eval $start if $b_log;
+ if (!$b_wmctrl) {
+ get_wm_main();
}
- 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],$data[6]);
+ if ( (!$desktop[5] || $b_wmctrl) && (my $program = main::check_program('wmctrl'))){
+ get_wm_wmctrl($program);
}
- 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],$data[6]);
+ eval $end if $b_log;
+}
+sub get_wm_main {
+ eval $start if $b_log;
+ my ($wms,$working);
+ # xprop is set only if not kde/gnome/cinnamon/mate/budgie/lx..
+ if ($b_xprop){
+ #KWIN_RUNNING
+ $wms = 'blackbox|compiz|kwin_wayland|kwin_x11|kwin|marco|muffin|';
+ $wms .= 'openbox|herbstluftwm|twin|wm2|windowmaker|i3';
+ foreach (@xprop){
+ if (/\b($wms)\b/){
+ $working = $1;
+ $working = 'wmaker' if $working eq 'windowmaker';
+ last;
+ }
+ }
}
- 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],$data[6]);
+ if (!$desktop[5]){
+ main::set_ps_gui() if ! $b_ps_gui;
+ # order matters, see above logic
+ $wms = '9wm|afterstep|amiwm|awesome|budgie-wm|compiz|fluxbox|blackbox|dwm|';
+ $wms .= 'flwm|fvwm-crystal|fvwm2|fvwm|gala|gnome-shell|i3|jwm|';
+ $wms .= 'twin|kwin_wayland|kwin_x11|kwin|matchbox-window-manager|marco|';
+ $wms .= 'muffin|mutter|metacity|mwm|notion|openbox|ratpoison|sawfish|scrotwm|spectrwm|';
+ $wms .= 'twm|windowlab|WindowMaker|wm2|wmii2|wmii|xfwm4|xfwm5|xmonad';
+ foreach (@ps_gui){
+ if (/^($wms)$/){
+ $working = $1;
+ last;
+ }
+ }
}
- 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],$data[6]);
+ get_wm_version('manual',$working) if $working;
+ $desktop[5] = $working if !$desktop[5] && $working;
+ eval $end if $b_log;
+}
+sub get_wm_wmctrl {
+ eval $start if $b_log;
+ my ($program) = @_;
+ my $cmd = "$program -m 2>/dev/null";
+ my @data = main::grabber($cmd,'','strip');
+ main::log_data('dump','@data',\@data) if $b_log;
+ $desktop[5] = main::awk(\@data,'^Name',2,'\s*:\s*');
+ $desktop[5] = '' if $desktop[5] && $desktop[5] eq 'N/A';
+ if ($desktop[5]){
+ # variants: gnome shell;
+ # IceWM 1.3.8 (Linux 3.2.0-4-amd64/i686) ; Metacity (Marco) ; Xfwm4
+ $desktop[5] =~ s/\d+\.\d\S+|[\[\(].*\d+\.\d.*[\)\]]//g;
+ $desktop[5] = main::trimmer($desktop[5]);
+ # change Metacity (Marco) to marco
+ if ($desktop[5] =~ /marco/i) {$desktop[5] = 'marco'}
+ elsif (lc($desktop[5]) eq 'gnome shell') {$desktop[5] = 'gnome-shell'}
+ elsif ($desktop_session eq 'trinity' && lc($desktop[5]) eq 'kwin') {$desktop[5] = 'Twin'}
+ get_wm_version('wmctrl',$desktop[5]);
}
eval $end if $b_log;
}
-
-sub get_wm {
+sub get_wm_version {
eval $start if $b_log;
- if ( my $program = main::check_program('wmctrl') ){
- my $cmd = "$program -m 2>/dev/null";
- my @data = main::grabber($cmd,'','strip');
- main::log_data('dump','@data',\@data) if $b_log;
- $desktop[5] = main::awk(\@data,'^Name',2,'\s*:\s*');
- if ($desktop[5]){
- # variants: gnome shell;
- # IceWM 1.3.8 (Linux 3.2.0-4-amd64/i686) ; Metacity (Marco) ; Xfwm4
- $desktop[5] =~ s/\d+\.\d\S+|[\[\(].*\d+\.\d.*[\)\]]//g;
- $desktop[5] = main::trimmer($desktop[5]);
-# my $temp = (split /\s+/, $desktop[5])[0];
-# if ($temp){
-# $temp = lc($temp);
-# @data = main::program_values($temp);
-# # print Data::Dumper::Dumper \@data;
-# if (@data){
-# my $version = main::program_version($temp,$data[0],$data[1],$data[2],$data[5],$data[6]);
-# $desktop[5] .= ' ' . $version if $version;
-# }
-# }
+ my ($type,$wm) = @_;
+ # we don't want the gnome-shell version, and the others have no --version
+ # we also don't want to run --version again on stuff we already have tested
+ return if ! $wm || $wm =~ /^(budgie-wm|gnome-shell)$/ || ($desktop[0] && lc($desktop[0]) eq lc($wm) );
+ my $temp = (split /\s+/, $wm)[0];
+ if ($temp){
+ $temp = (split /\s+/, $temp)[0];
+ $temp = lc($temp);
+ $temp = 'wmaker' if $temp eq 'windowmaker';
+ my @data = main::program_values($temp);
+ return if !@data;
+ # print Data::Dumper::Dumper \@data;
+ $desktop[5] = $data[3] if $type eq 'manual';
+ # note: if values returns 0 for 1 and 2, it doesn't support versioning
+ if ($extra > 2 && $data[1] && $data[2]){
+ my $version = main::program_version($temp,$data[0],$data[1],$data[2],$data[5],$data[6]);
+ $desktop[6] = $version if $version;
}
}
eval $end if $b_log;
@@ -15373,9 +15645,10 @@ sub set_gtk_data {
sub set_info_data {
eval $start if $b_log;
my (@data,@info,$item);
- my $pattern = 'gnome-shell|gnome-panel|kicker|lxpanel|mate-panel|';
- $pattern .= 'plasma-desktop|plasma-netbook|xfce4-panel';
- if (@data = grep {/($pattern)(\s|$)/} @ps_cmd ) {
+ my $pattern = 'gnome-panel|kicker|lxpanel|lxqt-panel|matchbox-panel|';
+ $pattern .= 'mate-panel|plasma-desktop|plasma-netbook|razor-panel|razorqt-panel|';
+ $pattern .= 'wingpanel|xfce4-panel|xfce5-panel';
+ if (@data = grep {/^($pattern)$/} @ps_gui ) {
# only one entry per type, can be multiple
foreach $item (@data){
if (! grep {$item =~ /$_/} @info){
@@ -15395,8 +15668,10 @@ sub set_xprop {
@xprop = main::grabber("xprop -root $display_opt 2>/dev/null");
if (@xprop){
# add wm / de as required, but only add what is really tested for above
- my $pattern = 'blackbox_pid|enlightenment|^_gnome|herbstluftwm|';
- $pattern .= '^i3_|icewm|_marco|_muffin|openbox_pid|^windowmaker|^_wm2|xfce';
+ # XFDESKTOP_IMAGE_FILE; XFCE_DESKTOP
+ my $pattern = '^amiwm|blackbox_pid|compiz|enlightenment|^_gnome|herbstluftwm|';
+ $pattern .= '^kwin_|^i3_|icewm|_marco|^_motif|_muffin|openbox_pid|';
+ $pattern .= '^_?windowmaker|^_wm2|^(xfdesktop|xfce)';
# let's only do these searches once
@xprop = grep {/^\S/ && /($pattern)/i} @xprop;
$_ = lc for @xprop;
@@ -15461,7 +15736,7 @@ sub get_display_manager {
# unknown dm, so we'll keep output to N/A
log_data('dump','display manager: @found',\@found) if $b_log;
eval $end if $b_log;
- return join ',', @found if @found;
+ return join ', ', @found if @found;
}
## Get DistroData
@@ -15504,17 +15779,19 @@ sub get_linux_distro {
eval $start if $b_log;
my ($distro,$distro_id,$distro_file,$system_base) = ('','','','');
my ($b_issue,$b_osr,$b_use_issue,@working);
+ # order matters!
my @derived = qw(antix-version aptosid-version kanotix-version knoppix-version
- mandrake-release manjaro-release mx-version pardus-release porteus-version sabayon-release
- siduction-version sidux-version slitaz-release solusos-release turbolinux-release
- zenwalk-version);
+ pclinuxos-release mandrake-release manjaro-release mx-version pardus-release
+ porteus-version sabayon-release siduction-version sidux-version slitaz-release
+ solusos-release turbolinux-release zenwalk-version);
my $derived_s = join "|", @derived;
- my @primary = qw(arch-release gentoo-release redhat-release slackware-version
+ my @primary = qw(altlinux-release arch-release gentoo-release redhat-release slackware-version
SuSE-release);
my $primary_s = join "|", @primary;
my $exclude_s = 'debian_version|devuan_version|ubuntu_version';
+ # note, pclinuxos has all these mandrake/mandriva files, careful!
my $lsb_good_s = 'mandrake-release|mandriva-release|mandrakelinux-release|manjaro-release';
- my $os_release_good_s = 'arch-release|rpi-issue|SuSE-release';
+ my $os_release_good_s = 'altlinux-release|arch-release|pclinuxos-release|rpi-issue|SuSE-release';
# note: always exceptions, so wild card after release/version:
# /etc/lsb-release-crunchbang
# wait to handle since crunchbang file is one of the few in the world that
@@ -15522,38 +15799,34 @@ sub get_linux_distro {
my @distro_files = main::globber('/etc/*[-_]{[rR]elease,[vV]ersion,issue}*');
my $lsb_release = '/etc/lsb-release';
my $b_lsb = 1 if -f $lsb_release;
- my ($etc_issue,$issue) = ('','/etc/issue');
+ my ($etc_issue,$issue,$lc_issue) = ('','/etc/issue','');
$b_issue = 1 if -f $issue;
# note: OpenSuse Tumbleweed 2018-05 has made /etc/issue created by sym link to /run/issue
# and then made that resulting file 700 permissions, which is obviously a mistake
$etc_issue = (main::reader($issue))[0] if -r $issue;
+ $etc_issue = main::clean_characters($etc_issue);
my $os_release = '/etc/os-release';
@osr = main::reader($os_release) if -r $os_release;
# debian issue can end with weird escapes like \n \l
# antergos: Antergos Linux \r (\l)
if ($etc_issue){
- $etc_issue = main::clean_characters($etc_issue);
- if ($etc_issue =~ /antergos/i){
- $distro_id = 'antergos';
+ $lc_issue = lc($etc_issue) if $etc_issue;
+ if ($lc_issue =~ /(antergos|grml|linux lite)/){
+ $distro_id = $1;
$b_use_issue = 1;
}
- if (lc($etc_issue) =~ /(raspbian|peppermint)/){
+ elsif ($lc_issue =~ /(raspbian|peppermint)/){
$distro_id = $1;
$distro_file = $os_release if @osr;
}
- elsif (lc($etc_issue) =~ /(grml)/){
- $distro_id = $1;
- $b_use_issue = 1;
- }
}
# Note that antergos changed this around # 2018-05, and now lists
# antergos in os-release, sigh... We want these distros to use os-release
# if it contains their names. Last check below
- if ( @osr && (grep {/manjaro|antergos|chakra/i} @osr ) ){
+ if ( @osr && (grep {/manjaro|antergos|chakra|pclinuxos/i} @osr ) ){
$distro_file = $os_release;
#$system_base = 'Arch Linux';
}
-
$distro_id = 'armbian' if grep {/armbian/} @distro_files;
main::log_data('dump','@distro_files',\@distro_files) if $b_log;
main::log_data('data',"distro_file-1: $distro_file") if $b_log;
@@ -15577,12 +15850,12 @@ sub get_linux_distro {
# if so, use lsb-release, if not, then just use the found file
# this is for only those distro's with self named release/version files
# because Mint does not use such, it must be done as below
- if ($b_lsb && $file =~ /$lsb_good_s/){
- $distro_file = $lsb_release;
- }
- elsif (@osr && $file =~ /($os_release_good_s)$/){
+ if (@osr && $file =~ /($os_release_good_s)$/){
$distro_file = $os_release;
}
+ elsif ($b_lsb && $file =~ /$lsb_good_s/){
+ $distro_file = $lsb_release;
+ }
else {
$distro_file = "/etc/$file";
}
@@ -15629,7 +15902,7 @@ sub get_linux_distro {
}
# otherwise try the default debian/ubuntu /etc/issue file
elsif ($b_issue){
- if ( !$distro_id && $etc_issue && lc($etc_issue) =~ /(mint|lmde)/ ){
+ if ( !$distro_id && $etc_issue && $lc_issue =~ /(mint|lmde)/ ){
$distro_id = $1;
$b_use_issue = 1;
}
@@ -15684,22 +15957,34 @@ sub get_linux_distro {
}
}
if ($extra > 0){
- my $base_default = 'antix-version|mx-version';
- my $base_issue = 'bunsen';
- my $base_manual = 'kali';
- my $base_osr = 'aptosid|grml|siduction';
- if (@osr){
+ my $base_default = 'antix-version|mx-version'; # osr has base ids
+ my $base_issue = 'bunsen'; # base only found in issue
+ my $base_manual = 'kali'; # synthesize, no direct data available
+ my $base_osr = 'aptosid|grml|siduction'; # osr base, distro id in list of distro files
+ my $base_osr_issue = 'grml|linux lite'; # osr base, distro id in issue
+ 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
+ # and anyone else who uses this method for fallback ID
+ if ( -r $base_upstream_osr){
+ my @osr_working = main::reader($base_upstream_osr);
+ if ( @osr_working){
+ my (@osr_temp);
+ @osr_temp = @osr;
+ @osr = @osr_working;
+ $system_base = get_os_release();
+ @osr = @osr_temp if !$system_base;
+ (@osr_temp,@osr_working) = (undef,undef);
+ }
+ }
+ elsif ( -r $base_upstream_lsb){
+ $system_base = get_lsb_release($base_upstream_lsb);
+ }
+ if (!$system_base && @osr){
my ($base_type) = ('');
if ($etc_issue && (grep {/($base_issue)/i} @osr)){
$system_base = $etc_issue;
}
- elsif ($etc_issue && lc($etc_issue) =~ /($base_manual)/){
- my $id = $1;
- my %manual = (
- 'kali' => 'Debian testing',
- );
- $system_base = $manual{$id};
- }
# more tests added here for other ubuntu derived distros
elsif ( @distro_files && (grep {/($base_default)/} @distro_files) ){
$base_type = 'default';
@@ -15707,13 +15992,22 @@ sub get_linux_distro {
elsif ($distro_id && $distro_id =~ /(mint)/){
$base_type = 'ubuntu';
}
- elsif (@distro_files && (grep {/($base_osr)/} @distro_files) && !(grep {/($base_osr)/i} @osr)){
+ elsif ( ( ($distro_id && $distro_id =~ /($base_osr_issue)/ ) ||
+ (@distro_files && (grep {/($base_osr)/} @distro_files)) ) &&
+ !(grep {/($base_osr)/i} @osr)){
$system_base = get_os_release();
}
if (!$system_base && $base_type){
$system_base = get_os_release($base_type);
}
}
+ if (!$system_base && $lc_issue && $lc_issue =~ /($base_manual)/){
+ my $id = $1;
+ my %manual = (
+ 'kali' => 'Debian testing',
+ );
+ $system_base = $manual{$id};
+ }
}
$distro =~ s/Debian/Armbian/ if ($distro && $distro_id eq 'armbian');
## finally, if all else has failed, give up
@@ -15724,8 +16018,10 @@ sub get_linux_distro {
sub get_lsb_release {
eval $start if $b_log;
+ my ($lsb_file) = @_;
+ $lsb_file ||= '/etc/lsb-release';
my ($distro,$id,$release,$codename,$description) = ('','','','','');
- my @content = main::reader('/etc/lsb-release');
+ my @content = main::reader($lsb_file);
main::log_data('dump','@content',\@content) if $b_log;
@content = map {s/,|\*|\\||\"|[:\47]|^\s+|\s+$|n\/a//ig; $_} @content if @content;
foreach (@content){
@@ -15906,6 +16202,28 @@ sub get_gcc_data {
eval $end if $b_log;
return @gccs;
}
+# rasberry pi only
+sub get_gpu_ram_arm {
+ eval $start if $b_log;
+ my ($gpu_ram) = (0);
+ if (my $program = check_program('vcgencmd')){
+ # gpu=128M
+ # "VCHI initialization failed" - you need to add video group to your user
+ my $working = (grabber("$program get_mem gpu 2>/dev/null"))[0];
+ $working = (split /\s*=\s*/, $working)[1] if $working;
+ $gpu_ram = translate_size($working) if $working;
+ }
+ log_data('data',"gpu ram: $gpu_ram") if $b_log;
+ eval $end if $b_log;
+ return $gpu_ram;
+}
+# standard systems
+sub get_gpu_ram {
+ eval $start if $b_log;
+ my ($gpu_ram) = (0);
+ eval $end if $b_log;
+ return $gpu_ram;
+}
sub get_hostname {
eval $start if $b_log;
@@ -16066,9 +16384,7 @@ sub get_memory_data {
sub get_memory_data_linux {
eval $start if $b_log;
my ($type,$file) = @_;
- my $memory = '';
- my $total = 0;
- my $not_used = 0;
+ my ($gpu,$memory,$not_used,$total) = (0,'',0,0);
my @data = reader($file);
foreach (@data){
if ($_ =~ /^MemTotal:/){
@@ -16078,14 +16394,17 @@ sub get_memory_data_linux {
$not_used += get_piece($_,2);
}
}
- my $used = $total - $not_used;
+ $gpu = get_gpu_ram_arm() if $b_arm;
+ #$gpu = translate_size('128M');
+ $total += $gpu;
+ my $used = $total - ($not_used);
my $percent = ($used && $total) ? sprintf("%.1f", ($used/$total)*100) : '';
if ($type eq 'string'){
$percent = " ($percent%)" if $percent;
$memory = sprintf("%.1f/%.1f MiB", $used/1024, $total/1024) . $percent;
}
else {
- $memory = "$total:$used:$percent";
+ $memory = "$total:$used:$percent:$gpu";
}
log_data('data',"memory: $memory") if $b_log;
eval $end if $b_log;
@@ -16181,7 +16500,7 @@ sub get_memory_data_bsd {
$memory = "$used/$real_mem MB" . $percent;
}
else {
- $memory = "$real_mem:$used:$percent";
+ $memory = "$real_mem:$used:$percent:0";
}
}
eval $end if $b_log;
@@ -16212,6 +16531,26 @@ sub get_module_version {
return $version;
}
+# args: 1 - pci device string; 2 - pci cleaned subsystem string
+sub get_pci_vendor {
+ eval $start if $b_log;
+ my ($device, $subsystem) = @_;
+ return if !$subsystem;
+ my ($vendor,$sep) = ('','');
+ my @data = split /\s+/, $subsystem;
+ foreach (@data){
+ if ($device !~ !/\b$_\b/){
+ $vendor .= $sep . $_;
+ $sep = ' ';
+ }
+ else {
+ last;
+ }
+ }
+ eval $end if $b_log;
+ return $vendor;
+}
+
# # check? /var/run/nologin for bsds?
sub get_runlevel_data {
eval $start if $b_log;
@@ -16420,10 +16759,16 @@ sub get_ssh_status {
sub get_tty_console_irc {
eval $start if $b_log;
- return $tty_session if $tty_session;
- my $ppid = getppid();
- $tty_session = awk(\@ps_aux,".*$ppid.*$client{'name'}",7,'\s+');
- $tty_session =~ s/^[^[0-9]+// if $tty_session;
+ my ($type) = @_;
+ return $tty_session if defined $tty_session;
+ if ( $type eq 'vtrn' && defined $ENV{'XDG_VTNR'} ){
+ $tty_session = $ENV{'XDG_VTNR'};
+ }
+ else {
+ my $ppid = getppid();
+ $tty_session = awk(\@ps_aux,".*$ppid.*$client{'name'}",7,'\s+');
+ $tty_session =~ s/^[^[0-9]+// if $tty_session;
+ }
$tty_session = '' if ! defined $tty_session;
log_data('data',"conole-irc-tty:$tty_session") if $b_log;
eval $end if $b_log;
@@ -16432,9 +16777,15 @@ sub get_tty_console_irc {
sub get_tty_number {
eval $start if $b_log;
- my $tty = POSIX::ttyname(1);
- #variants: /dev/pts/1 /dev/tty1 /dev/ttyp2 /dev/ttyra [hex number a]
- $tty =~ s/.*\/[^0-9]*//g if defined $tty;
+ my ($tty);
+ if ( defined $ENV{'XDG_VTNR'} ){
+ $tty = $ENV{'XDG_VTNR'};
+ }
+ else {
+ $tty = POSIX::ttyname(1);
+ #variants: /dev/pts/1 /dev/tty1 /dev/ttyp2 /dev/ttyra [hex number a]
+ $tty =~ s/.*\/[^0-9]*//g if defined $tty;
+ }
$tty = '' if ! defined $tty;
log_data('data',"tty:$tty") if $b_log;
eval $end if $b_log;
@@ -16549,8 +16900,9 @@ sub get_usb_path {
return $path
}
+
#### -------------------------------------------------------------------
-#### INITIALIZE DATA VALUES
+#### SET DATA VALUES
#### -------------------------------------------------------------------
sub set_dmesg_boot_data {
@@ -16857,8 +17209,8 @@ sub set_pci_data {
# ! -d '/proc/bus/pci'
# this is sketchy, a sbc won't have pci, but a non sbc arm may have it, so
# build up both and see what happens
- if ($b_arm ){
- set_arm_soc_data();
+ if ($b_arm || $b_mips){
+ set_soc_data();
}
}
else {
@@ -16883,10 +17235,12 @@ sub set_pci_data {
# 9 driver
# 10 modules
# 11 driver_nu [bsd, like: em0 - driver em; nu 0. Used to match IF in -n
+# 12 subsystem/vendor
+# 13 subsystem vendor:chip id
sub set_lspci_data {
eval $start if $b_log;
my ($busid,$busid_nu,$content,$port,$driver,$modules,$device,$vendor_id,$chip_id,$rev,
- $type,$type_id,@pcis,@temp,@working);
+ $subsystem,$subsystem_id,$type,$type_id,@pcis,@temp,@working);
# my @pcis = grabber('lspci -nnv','\n','strip');
my $path = check_program('lspci');
$content = qx($path -nnv 2>/dev/null) if $path;
@@ -16902,11 +17256,20 @@ sub set_lspci_data {
if ($device){
if ($_ =~ /^\s*$/) {
@temp = ($type,$type_id,$busid,$busid_nu,$device,$vendor_id,$chip_id,
- $rev,$port,$driver,$modules);
+ $rev,$port,$driver,$modules,$subsystem,$subsystem_id);
@pci = (@pci,[@temp]);
$device = '';
#print "$busid $device_id r:$rev p: $port\n$type\n$device\n";
}
+ elsif ($_ =~ /^Subsystem.*\[([a-f0-9]{4}:[a-f0-9]{4})\]/){
+ $subsystem_id = $1;
+ $subsystem = (split /^Subsystem:\s*/,$_)[1];
+ $subsystem =~ s/(\s?\[[^\]]+\])+$//g;
+ $subsystem = cleaner($subsystem);
+ $subsystem = pci_cleaner($subsystem,'pci');
+ $subsystem = pci_cleaner_subsystem($subsystem);
+ #print "ss:$subsystem\n";
+ }
elsif ($_ =~ /^I\/O\sports/){
$port = (split /\s+/,$_)[3];
#print "p:$port\n";
@@ -16917,7 +17280,6 @@ sub set_lspci_data {
elsif ($_ =~ /^Kernel\smodules/i){
$modules = (split /:\s*/,$_)[1];
}
-
}
# note: arm servers can have more complicated patterns
# 0002:01:02.0 Ethernet controller [0200]: Cavium, Inc. THUNDERX Network Interface Controller virtual function [177d:a034] (rev 08)
@@ -16940,10 +17302,13 @@ sub set_lspci_data {
$port = '';
$driver = '';
$modules = '';
+ $subsystem = '';
+ $subsystem_id = '';
}
}
if ($device && $busid){
- @temp = ($type,$type_id,$busid,$busid_nu,$device,$vendor_id,$chip_id,$rev,$port,$driver,$modules);
+ @temp = ($type,$type_id,$busid,$busid_nu,$device,$vendor_id,$chip_id,
+ $rev,$port,$driver,$modules,$subsystem,$subsystem_id);
@pci = (@pci,[@temp]);
$device = '';
}
@@ -17050,19 +17415,44 @@ sub set_pciconf_data {
# "OF_COMPATIBLE_0=allwinner,sun8i-h3-mali", "OF_COMPATIBLE_1=allwinner,sun7i-a20-mali",
# "OF_COMPATIBLE_2=arm,mali-400", "OF_COMPATIBLE_N=3",
# "MODALIAS=of:NgpuT<NULL>Callwinner,sun8i-h3-maliCallwinner,sun7i-a20-maliCarm,mali-400"]
-sub set_arm_soc_data {
+## 5
+# /sys/devices/platform/soc/soc:internal-regs/d0018180.gpio/uevent
+## 6
+# /sys/devices/soc.0/1180000001800.mdio/8001180000001800:05/uevent
+# ["DRIVER=AR8035", "OF_NAME=ethernet-phy"
+## 7
+# /sys/devices/soc.0/1c30000.eth/uevent
+## 8
+# /sys/devices/wlan.26/uevent [from pine64]
+sub set_soc_data {
eval $start if $b_log;
my ($content,@files,@temp2,@temp3,@working);
- @files = globber("/sys/devices/platform/soc*/*/uevent");
+ if (-d '/sys/devices/platform/'){
+ @files = globber('/sys/devices/platform/soc*/*/uevent');
+ @temp2 = globber('/sys/devices/platform/soc*/*/*/uevent');
+ @files = (@files,@temp2) if @temp2;
+ }
+ if (globber('/sys/devices/soc*')){
+ @temp2 = globber('/sys/devices/soc*/*/uevent');
+ @files = (@files,@temp2) if @temp2;
+ @temp2 = globber('/sys/devices/soc*/*/*/uevent');
+ @files = (@files,@temp2) if @temp2;
+ }
+ @temp2 = globber('/sys/devices/*/uevent'); # see case 8
+ @files = (@files,@temp2) if @temp2;
+ @temp2 = undef;
# not sure why, but even as root/sudo, /subsystem/uevent is unreadable with -r test true
@files = grep {!/subsystem/} @files if @files;
foreach my $file (@files){
+ next if -z $file;
my ($busid,$busid_nu,$chip_id,$device,$driver,$modules,$port,$rev,
- $type,$type_id,$vendor_id,@working);
+ $temp,$type,$type_id,$vendor_id,@working);
$chip_id = $file;
# variants: /soc/20100000.ethernet /soc/soc:audio /soc:/ /soc@0/
- $chip_id =~ /\/sys\/devices\/platform\/soc[^\/]*\/([^\/]+)[\.:][^\/]+\/uevent/;
- $chip_id = $1;
+ # mips: /sys/devices/soc.0/1180000001800.mdio/8001180000001800:07/
+ $chip_id =~ /\/sys\/devices\/(platform\/)?(soc[^\/]*\/)?([^\/]+\/)?([^\/]+\/)?([^\/]+)[\.:]([^\/]+)\/uevent$/;
+ $chip_id = $5;
+ $temp = $6;
@working = reader($file, 'strip') if -r $file;
foreach my $data (@working){
@temp2 = split /=/, $data;
@@ -17079,17 +17469,19 @@ sub set_arm_soc_data {
$vendor_id = $temp3[0];
}
}
- $type = '' if ! defined $type;
+ # it's worthless, we can't use it
+ next if ! defined $type;
$driver = '' if ! defined $driver;
- $busid = '';
+ $busid = (defined $temp && $temp =~ /^[0-9]+$/) ? $temp: 0;
$busid_nu = 0;
$type_id = '';
$port = '';
$rev = '';
$modules = '';
- $b_arm_audio = 1 if ($type eq 'audio' || $type eq 'hdmi' );
- $b_arm_gfx = 1 if ($type eq 'gpu' || $type eq 'fb' || $type eq 'hdmi');
- $b_arm_net = 1 if $type eq 'ethernet' || $type =~ /wifi/;
+ # note: use these for main Card match for -AGN
+ $b_soc_audio = 1 if $type =~ /^(audio|daudio|hdmi|multimedia)$/;
+ $b_soc_gfx = 1 if $type =~ /^(vga|disp|display|3d|fb|gpu|hdmi)$/;
+ $b_soc_net = 1 if $type =~ /^(eth|ethernet|ethernet-phy|network|wifi|wlan)$/;
@temp3 = ($type,$type_id,$busid,$busid_nu,$device,$vendor_id,$chip_id,$rev,$port,$driver,$modules);
@pci = (@pci,[@temp3]);
}
@@ -17097,7 +17489,6 @@ sub set_arm_soc_data {
main::log_data('dump','@pci',\@pci) if $b_log;
eval $end if $b_log;
}
-
sub set_ps_aux {
eval $start if $b_log;
@ps_aux = split "\n",qx(ps aux);;
@@ -17107,7 +17498,7 @@ sub set_ps_aux {
# for pinxi, we want to see the useage data for cpu/ram
@ps_aux = grep {!/\/$self_name\b/} @ps_aux if $self_name eq 'inxi';
# this is for testing for the presence of the command
- @ps_cmd = map {
+ @ps_cmd = grep {!/^\[/} map {
my @split = split /\s+/, $_;
# slice out 10th to last elements of ps aux rows
my $final = $#split;
@@ -17116,7 +17507,59 @@ sub set_ps_aux {
@split = @split[10 .. $final ];
join " ", @split;
} @ps_aux;
- print Dumper \@ps_aux if $test[5];
+ #@ps_cmd = grep {!/^\[/} @ps_cmd;
+ # never, because ps loaded before option handler
+ print Dumper \@ps_cmd if $test[5];
+ eval $end if $b_log;
+}
+sub set_ps_gui {
+ eval $start if $b_log;
+ $b_ps_gui = 1;
+ my ($working,@match,@temp);
+ # desktops
+ if ($show{'system'}){
+ @temp=qw(razor-desktop razor-session lxsession lxqt-session tdelauncher tdeinit_phase1);
+ @match = (@match,@temp);
+ @temp=qw(afterstep awesome blackbox 3dwm dwm fluxbox flwm
+ fvwm-crystal fvwm2 fvwm i3 jwm matchbox-panel openbox sawfish
+ scrotwm spectrwm twm WindowMaker wm2 wmii2 wmii);
+ @match = (@match,@temp);
+ }
+ # wm:
+ if ($show{'system'} && $extra > 1){
+ @temp=qw(9wm 3dwm afterstep amiwm awesome blackbox budgie-wm compiz
+ dwm fluxbox flwm fvwm-crystal fvwm2 fvwm gala gnome-shell i3 jwm
+ twin kwin_wayland kwin_x11 kwin marco matchbox-window-manager metacity
+ metisse mir muffin mutter mwm notion openbox ratpoison sawfish
+ scrotwm spectrwm twm windowlab WindowMaker wm2 wmii2 wmii xfwm4
+ xfwm5 xmonad);
+ @match = (@match,@temp);
+ }
+ # info:
+ if ($show{'system'} && $extra > 2){
+ @temp=qw(budgie-panel gnome-panel kicker lxpanel lxqt-panel
+ matchbox-panel mate-panel plasma-desktop plasma-netbook razor-panel
+ razorqt-panel wingpanel xfce4-panel xfce5-panel);
+ @match = (@match,@temp);
+ }
+ # compositors (for wayland these are also the server, note
+ if ($show{'graphic'} && $extra > 1){
+ @temp=qw(budgie-wm compiz compton dwc dcompmgr enlightenment
+ grefson ireplace kmscon kwin_wayland kwin_x11 metisse mir moblin
+ rustland sway swc unagi wayhouse westford weston xcompmgr);
+ @match = (@match,@temp);
+ }
+ @match = uniq(@match);
+ my $matches = join '|', @match;
+ foreach (@ps_cmd){
+ if (/^[\S]*\b($matches)(\s|$)/){
+ $working = $1;
+ push @ps_gui, $working; # deal with duplicates with uniq
+ }
+ }
+ @ps_gui = uniq(@ps_gui) if @ps_gui;
+ print Dumper \@ps_gui if $test[5];
+ log_data('dump','@ps_gui',\@ps_gui) if $b_log;
eval $end if $b_log;
}
@@ -17627,7 +18070,7 @@ sub generate_short_data {
main::key($num++,$kernel_os) => &get_kernel_data(),
main::key($num++,'Up') => &get_uptime(),
main::key($num++,'Mem') => $memory,
- main::key($num++,'HDD') => $disk_string,
+ main::key($num++,'Storage') => $disk_string,
# could make -1 for ps aux itself, -2 for ps aux and self
main::key($num++,'Procs') => scalar @ps_aux,
main::key($num++,$client_shell) => $client,
@@ -17651,7 +18094,7 @@ sub generate_info_data {
my $running_in = '';
my $data_name = main::key($prefix++,'Info');
my ($b_gcc,%row,$gcc,$index,$ref);
- my ($parent,$percent,$total,$used) = ('','','','');
+ my ($gpu_ram,$parent,$percent,$total,$used) = (0,'','','','');
my $client_shell = ($b_irc) ? 'Client' : 'Shell';
my $client = $client{'name-print'};
my @gccs = get_gcc_data();
@@ -17686,10 +18129,15 @@ sub generate_info_data {
if ($memory){
my @temp = split /:/, $memory;
my @temp2 = get_size($temp[0]);
+ $gpu_ram = $temp[3] if $temp[3];
$total = ($temp2[1]) ? $temp2[0] . ' ' . $temp2[1] : $temp2[0];
@temp2 = get_size($temp[1]);
$used = ($temp2[1]) ? $temp2[0] . ' ' . $temp2[1] : $temp2[0];
$used .= " ($temp[2]%)" if $temp[2];
+ if ($gpu_ram){
+ @temp2 = get_size($gpu_ram);
+ $gpu_ram = $temp2[0] . ' ' . $temp2[1] if $temp2[1];
+ }
}
$memory ||= 'N/A';
my %data = (
@@ -17697,10 +18145,13 @@ sub generate_info_data {
main::key($num++,'Processes') => scalar @ps_aux,
main::key($num++,'Uptime') => &get_uptime(),
main::key($num++,'Memory') => $total,
- main::key($num++,'used') => $used,
},],
);
$index = scalar(@{ $data{$data_name} } ) - 1;
+ $data{$data_name}[$index]{main::key($num++,'used')} = $used;
+ if ($gpu_ram){
+ $data{$data_name}[$index]{main::key($num++,'gpu')} = $gpu_ram;
+ }
if ( (!$b_display || $b_force_display) || $extra > 0 ){
my %init = get_init_data();
my $init_type = ($init{'init-type'}) ? $init{'init-type'}: 'N/A';
@@ -17806,18 +18257,21 @@ 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] || index(lc($desktop_data[5]),lc($desktop_data[0])) == -1 )){
+ if ($extra > 1 && $desktop_data[5] &&
+ (!$desktop_data[0] || $desktop_data[5] =~ /^(gnome[\s\-_]shell|budgie-wm)$/i ||
+ index(lc($desktop_data[5]),lc($desktop_data[0])) == -1 )){
$wm = $desktop_data[5];
+ $wm .= ' ' . $desktop_data[6] if $extra > 2 && $desktop_data[6];
}
}
- if (!$b_display || ( ! $desktop && $b_root)) {
+ if (!$b_display || ( !$desktop && $b_root)) {
my $tty = get_tty_number();
if (!$desktop){
$desktop_info = '';
}
# it is defined, as ''
if ( $tty eq '' && $client{'console-irc'}){
- $tty = get_tty_console_irc();
+ $tty = get_tty_console_irc('vtnr');
}
$desktop = "tty $tty" if $tty ne '';
$desktop_key = 'Console';
@@ -17831,15 +18285,17 @@ sub generate_system_data {
if ($desktop_info){
$data{$data_name}[$index]{main::key($num++,'info')} = $desktop_info;
}
- if ($wm){
- $data{$data_name}[$index]{main::key($num++,'wm')} = $wm;
- }
}
if ($extra > 1){
+ $data{$data_name}[$index]{main::key($num++,'wm')} = $wm if $wm;
my $dms = get_display_manager();
$dms ||= 'N/A';
$data{$data_name}[$index]{main::key($num++,'dm')} = $dms;
}
+ #if ($extra > 2 && $desktop_key ne 'Console'){
+ # my $tty = get_tty_number();
+ # $data{$data_name}[$index]{main::key($num++,'vc')} = $tty if $tty ne '';
+ #}
my $distro_key = ($bsd_type) ? 'OS': 'Distro';
my @distro_data = DistroData::get();
my $distro = $distro_data[0];