summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xinxi1108
-rw-r--r--inxi.1396
-rw-r--r--inxi.changelog181
3 files changed, 1340 insertions, 345 deletions
diff --git a/inxi b/inxi
index 039f179..8ffeee8 100755
--- a/inxi
+++ b/inxi
@@ -22,6 +22,7 @@ use 5.008;
use Cwd qw(abs_path); # qw(abs_path);#abs_path realpath getcwd
use Data::Dumper qw(Dumper); # print_r
use File::Find;
+use File::stat; # needed for Xorg.0.log file mtime comparisons
use Getopt::Long qw(GetOptions);
# Note: default auto_abbrev is enabled, that's fine
Getopt::Long::Configure ('bundling', 'no_ignore_case',
@@ -31,8 +32,8 @@ use POSIX qw(uname strftime ttyname);
## INXI INFO ##
my $self_name='inxi';
-my $self_version='3.0.38';
-my $self_date='2020-03-14';
+my $self_version='3.1.00';
+my $self_date='2020-04-22';
my $self_patch='00';
## END INXI INFO ##
@@ -62,7 +63,7 @@ my (@app,@dmesg_boot,@devices_audio,@devices_graphics,@devices_network,
@sysctl,@sysctl_battery,@sysctl_sensors,@sysctl_machine,@uname,@usb);
## Disk arrays
my (@dm_boot_disk,@dm_boot_optical,@glabel,@gpart,@hardware_raid,@labels,
-@lsblk,@partitions,@raid,@sysctl_disks,@uuids);
+@lsblk,@partitions,@raid,@swaps,@sysctl_disks,@uuids);
my @test = (0,0,0,0,0);
## Booleans
@@ -74,7 +75,8 @@ $b_log,$b_log_colors,$b_log_full,$b_man,$b_mem,$b_mips,$b_no_sudo,
$b_pci,$b_pci_tool,$b_ppc,$b_proc_partitions,$b_ps_gui,
$b_root,$b_running_in_display,$b_skip_dig,
$b_slot_tool,$b_soc_audio,$b_soc_gfx,$b_soc_net,$b_soc_timer,$b_sparc,
-$b_sudo,$b_sysctl,$b_usb,$b_usb_check,$b_usb_sys,$b_usb_tool,$b_wmctrl);
+$b_sudo,$b_swaps,$b_sysctl,$b_usb,$b_usb_check,$b_usb_sys,$b_usb_tool,
+$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,$b_smartctl);
@@ -571,24 +573,62 @@ sub system_files {
'partitions' => '/proc/partitions',
'scsi' => '/proc/scsi/scsi',
'version' => '/proc/version',
- 'xorg-log' => '/var/log/Xorg.0.log'
+ # note: 'xorg-log' is set only if -G is triggered
);
foreach ( keys %files ){
$system_files{$_} = ( -e $files{$_} ) ? $files{$_} : '';
}
- if ( ! $system_files{'xorg-log'} && check_program('xset') ){
- my $data = qx(xset q 2>/dev/null);
- foreach ( split /\n/, $data){
- if ($_ =~ /Log file/i){
- $system_files{'xorg-log'} = get_piece($_,3);
- last;
+ }
+ else {
+ return $system_files{$file};
+ }
+}
+sub set_xorg_log {
+ eval $start if $b_log;
+ my (@temp,@x_logs);
+ my ($file_holder,$time_holder,$x_mtime) = ('',0,0);
+ # NOTE: other variations may be /var/run/gdm3/... but not confirmed
+ # we are just going to get all the Xorg logs we can find, and not worry about
+ # which is 'right'.
+ @temp = globber('/var/log/Xorg.*.log');
+ push @x_logs, @temp if @temp;
+ @temp = globber('/var/lib/gdm/.local/share/xorg/Xorg.*.log');
+ push @x_logs, @temp if @temp;
+ @temp = globber($ENV{'HOME'} . '/.local/share/xorg/Xorg.*.log',);
+ push @x_logs, @temp if @temp;
+ # root will not have a /root/.local/share/xorg directory so need to use a
+ # user one if we can find one.
+ if ($b_root){
+ @temp = globber('/home/*/.local/share/xorg/Xorg.*.log');
+ push @x_logs, @temp if @temp;
+ }
+ foreach (@x_logs){
+ if (-r $_){
+ my $src_info = File::stat::stat("$_");
+ #print "$_\n";
+ if ($src_info){
+ $x_mtime = $src_info->mtime;
+ # print $_ . ": $x_time" . "\n";
+ if ($x_mtime > $time_holder ){
+ $time_holder = $x_mtime;
+ $file_holder = $_;
}
}
}
}
- else {
- return $system_files{$file};
+ if ( !$file_holder && check_program('xset') ){
+ my $data = qx(xset q 2>/dev/null);
+ foreach ( split /\n/, $data){
+ if ($_ =~ /Log file/i){
+ $file_holder = get_piece($_,3);
+ last;
+ }
+ }
}
+ print "Xorg log file: $file_holder\nLast modified: $time_holder\n" if $test[14];
+ log_data('data',"Xorg log file: $file_holder") if $b_log;
+ $system_files{'xorg-log'} = $file_holder;
+ eval $end if $b_log;
}
########################################################################
@@ -1089,6 +1129,7 @@ sub get_config_item {
elsif ($key eq 'LANGUAGE') {$language = $val if $val =~ /^(en)$/}
elsif ($key eq 'LIMIT') {$limit = $val if is_int($val)}
elsif ($key eq 'OUTPUT_TYPE') {$output_type = $val if $val =~ /^(json|screen|xml)$/}
+ elsif ($key eq 'NO_DIG') {$b_skip_dig = $val if is_int($val)}
elsif ($key eq 'NO_SUDO') {$b_no_sudo = $val if is_int($val)}
elsif ($key eq 'PARTITION_SORT') {$show{'partition-sort'} = $val if ($val =~ /^(dev-base|fs|id|label|percent-used|size|uuid|used)$/) }
elsif ($key eq 'PS_COUNT') {$ps_count = $val if is_int($val) }
@@ -1568,7 +1609,13 @@ sub display_data {
else {
@files = ('/xorg-conf-d');
}
- push (@files, $files{'xorg-log'});
+ # keep this updated to handle all possible locations we know about for Xorg.0.log
+ # not using $system_files{'xorg-log'} for now though it would be best to know what file is used
+ main::set_xorg_log();
+ push (@files, '/var/log/Xorg.0.log');
+ push (@files, '/var/lib/gdm/.local/share/xorg/Xorg.0.log');
+ push (@files, $ENV{'HOME'} . '/.local/share/xorg/Xorg.0.log');
+ push (@files, $system_files{'xorg-log'}) if $system_files{'xorg-log'};
push (@files, '/etc/X11/xorg.conf');
copy_files(\@files,'display-xorg');
print "Collecting X, xprop, glxinfo, xrandr, xdpyinfo data, wayland, weston...\n";
@@ -1836,7 +1883,7 @@ sub run_self {
my $z = ($debugger{'z'}) ? ' -z' : '';
my $iz = "$i$z";
$iz =~ s/[\s-]//g;
- my $cmd = "$self_path/$self_name -FRfrploudmaxxx$i$z --usb --slots --debug 10 -y 120 > $data_dir/$self_name-FRfrploudmaxxx$iz-usb-slots-y120.txt 2>&1";
+ my $cmd = "$self_path/$self_name -FRfJrploudmaxxx$i$z --slots --debug 10 -y 120 > $data_dir/$self_name-FRfJrploudmaxxx$iz-slots-y120.txt 2>&1";
system($cmd);
copy($log_file, "$data_dir") or main::error_handler('copy-failed', "$log_file", "$!");
system("$self_path/$self_name --recommends -y 120 > $data_dir/$self_name-recommends-120.txt 2>&1");
@@ -2231,7 +2278,10 @@ sub download_file {
sub get_file {
my ($type, $url, $file) = @_;
- my $response = HTTP::Tiny->new->get($url);
+ my $tiny = HTTP::Tiny->new;
+ # note: default is no verify, so default here actually is to verify unless overridden
+ $tiny->verify_SSL => 1 if !$dl{'no-ssl-opt'};
+ my $response = $tiny->get($url);
my $return = 1;
my $debug = 0;
my $fh;
@@ -2856,8 +2906,8 @@ sub item_data {
'rpm' => 'util-linux-ng',
}),
'lsusb' => ({
- 'info' => '-A usb audio; -N usb networking; --usb (optional)',
- 'info-bsd' => '-A; -N; --usb. Alternate to usbdevs',
+ 'info' => '-A usb audio; -J (optional); -N usb networking',
+ 'info-bsd' => '-A; -J; -N. Alternate to usbdevs',
'apt' => 'usbutils',
'pacman' => 'usbutils',
'rpm' => 'usbutils',
@@ -2934,7 +2984,7 @@ sub item_data {
}),
'usbdevs' => ({
'info' => '',
- 'info-bsd' => '-A; -N; --usb;',
+ 'info-bsd' => '-A; -J; -N;',
'apt' => 'usbutils',
'pacman' => 'usbutils',
'rpm' => 'usbutils',
@@ -3440,6 +3490,7 @@ sub program_values {
'mksh' => ['ksh',5,'-v','mksh',1,0,0],
'pdksh' => ['ksh',5,'-v','pdksh',1,0,0],
'tcsh' => ['^tcsh',2,'--version','tcsh',1,0,0],
+ 'xonsh' => ['^xonsh',1,'--version','xonsh',1,0,0],
'zsh' => ['^zsh',2,'--version','zsh',1,0,0],
## Tools
'clang' => ['clang',3,'--version','Clang',1,0,0],
@@ -3543,7 +3594,7 @@ sub program_version {
# breaks version detection. A quick fix attempt is to just add 1 to $num
# to get the next value.
$version_nu = $data[$num+1] if $data[$num+1] && $version_nu =~ /version/i;
- $version_nu =~ s/(\([^)]+\)|,|"|dwm-|wmii2-|wmii-|\||\(|\))//g if $version_nu;
+ $version_nu =~ s/(\([^)]+\)|,|"|dwm-|xonsh\/|wmii2-|wmii-|\||\(|\))//g if $version_nu;
# trim off leading v but only when followed by a number
$version_nu =~ s/^v([0-9])/$1/i if $version_nu;
# print "$version_nu\n";
@@ -3849,6 +3900,7 @@ sub get_options{
$show{'raid-basic'} = 1;
$show{'disk-total'} = 1;
$show{'graphic'} = 1;
+ $show{'graphic-basic'} = 1;
$show{'info'} = 1;
$show{'machine'} = 1;
$show{'network'} = 1;
@@ -3889,6 +3941,7 @@ sub get_options{
$show{'cpu'} = 1;
$show{'disk'} = 1;
$show{'graphic'} = 1;
+ $show{'graphic-basic'} = 1;
$show{'info'} = 1;
$show{'machine'} = 1;
$show{'network'} = 1;
@@ -3896,10 +3949,14 @@ sub get_options{
$show{'partition'} = 1;
$show{'raid'} = 1;
$show{'sensor'} = 1;
+ $show{'swap'} = 1;
$show{'system'} = 1; },
'G|graphics|graphic' => sub {
$show{'short'} = 0;
- $show{'graphic'} = 1; },
+ $show{'graphic'} = 1;
+ $show{'graphic-basic'} = 1; },
+ 'h|help|?' => sub {
+ $b_help = 1; },
'i|ip' => sub {
$show{'short'} = 0;
$show{'ip'} = 1;
@@ -3909,6 +3966,12 @@ sub get_options{
'I|info' => sub {
$show{'short'} = 0;
$show{'info'} = 1; },
+ 'j|swap|swaps' => sub {
+ $show{'short'} = 0;
+ $show{'swap'} = 1; },
+ 'J|usb' => sub {
+ $show{'short'} = 0;
+ $show{'usb'} = 1; },
'l|labels|label' => sub {
$show{'short'} = 0;
$show{'label'} = 1;
@@ -4004,9 +4067,6 @@ sub get_options{
else {
error_handler('bad-arg',$opt,$arg);
} },
- 'usb' => sub {
- $show{'short'} = 0;
- $show{'usb'} = 1; },
'u|uuid' => sub {
$show{'short'} = 0;
$show{'partition'} = 1;
@@ -4022,6 +4082,7 @@ sub get_options{
$show{'cpu-basic'} = 1;
$show{'disk-total'} = 1;
$show{'graphic'} = 1;
+ $show{'graphic-basic'} = 1;
$show{'info'} = 1;
$show{'system'} = 1;
}
@@ -4049,6 +4110,7 @@ sub get_options{
$show{'ram'} = 1;
$show{'raid'} = 1;
$show{'sensor'} = 1;
+ $show{'swap'} = 1;
$show{'uuid'} = 1;
}
if ($arg >= 6 ){
@@ -4079,6 +4141,8 @@ sub get_options{
else {
error_handler('bad-arg',$opt,$arg);
} },
+ 'V|version' => sub {
+ $b_version = 1 },
'w|weather' => sub {
my ($opt) = @_;
$show{'short'} = 0;
@@ -4149,8 +4213,12 @@ sub get_options{
} },
'z|filter' => sub {
$use{'filter'} = 1; },
+ 'filter-label' => sub {
+ $use{'filter-label'} = 1; },
'Z|filter-override' => sub {
$use{'filter-override'} = 1; },
+ 'filter-uuid' => sub {
+ $use{'filter-uuid'} = 1; },
## Start non data options
'alt:i' => sub {
my ($opt,$arg) = @_;
@@ -4235,6 +4303,8 @@ sub get_options{
$debugger{'test-1'} = 1; },
'debug-z' => sub {
$debugger{'z'} = 1 },
+ 'dig' => sub {
+ $b_skip_dig = 0; },
'display:s' => sub {
my ($opt,$arg) = @_;
if ($arg =~ /^:?([0-9]+)?$/){
@@ -4282,8 +4352,6 @@ sub get_options{
else {
error_handler('bad-arg', $opt, $arg);
}},
- 'h|help|?' => sub {
- $b_help = 1; },
'host|hostname' => sub {
$show{'host'} = 1;
$show{'no-host'} = 0},
@@ -4314,6 +4382,8 @@ sub get_options{
else {
error_handler('bad-arg', $opt, $arg);
}},
+ 'no-dig' => sub {
+ $b_skip_dig = 1; },
'no-host|no-hostname' => sub {
$show{'host'} = 0 ;
$show{'no-host'} = 1},
@@ -4388,8 +4458,6 @@ sub get_options{
$b_usb_sys = 1 },
'usb-tool' => sub {
$b_usb_tool = 1 },
- 'V|version' => sub {
- $b_version = 1 },
'wan-ip-url:s' => sub {
my ($opt,$arg) = @_;
if ($arg && $arg =~ /^(f|ht)tp[s]?:\/\//){
@@ -4408,7 +4476,8 @@ sub get_options{
## run all these after so that we can change widths, downloaders, etc
eval $end if $b_log;
CheckRecommends::run() if $b_recommends;
- set_downloader() if $b_downloader || $wan_url; # sets for either config or arg here
+ set_downloader() if $b_downloader || $wan_url || ($b_skip_dig && $show{'ip'}); # sets for either config or arg here
+ set_xorg_log() if $show{'graphic'};
show_version() if $b_version;
show_options() if $b_help;
$b_man = 0 if (!$b_use_man || $b_no_man_force);
@@ -4418,6 +4487,7 @@ sub get_options{
error_handler('bad-arg', '--output', '--output-file not provided');
}
}
+ $show{'graphic-basic'} = 0 if $b_admin;
$b_block_tool = 1 if ( $b_admin && ($show{'partition'} || $show{'partition-full'} ));
$b_sudo = 1 if ( $show{'unmounted'} || ($extra > 0 && $show{'disk'}) );
$extra = 3 if $b_admin;
@@ -4439,7 +4509,7 @@ sub get_options{
if ($show{'audio'} || $show{'graphic'} || $show{'network'} || $show{'raid'} || $show{'raid-forced'} ){
$b_pci = 1;
}
- if ($show{'usb'} || $show{'audio'} || $show{'network'} ){
+ if ($show{'usb'} || $show{'audio'} || $show{'graphic'} || $show{'network'} ){
$b_usb = 1;
}
if ($bsd_type && ($show{'short'} || $show{'system'} || $show{'battery'} || $show{'cpu'} || $show{'cpu-basic'} ||
@@ -4475,17 +4545,18 @@ sub show_options {
$line = $line . '- ';
}
@rows = (
- ['0', '', '', "$self_name supports the following options. You can combine
- these or list them one by one. For more detailed information, see man^$self_name.
- 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', '', '', "$self_name supports the following options. For more detailed
+ information, see man^$self_name. If you start $self_name with no arguments,
+ it will display a short system summary." ],
['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
- to show just the line(s) you want to see. If you use them with -v [level],
- -b or -F, $self_name will combine the outputs." ],
+ ['0', '', '', "You can use these options alone or together,
+ to show or add the item(s) you want to see: A, B, C, D, G, I, J, M, N, P,
+ R, S, W, d, f, i, j, l, m, n, o, p, r, s, t, u, w, --slots.
+ If you use them with -v [level], -b or -F, $self_name will add the requested
+ lines to the output." ],
+ ['0', '', '', '' ],
+ ['0', '', '', "Examples:^$self_name^-v4^-c6 OR $self_name^-bDc^6 OR
+ $self_name^-FzjJxy^80" ],
['0', '', '', $line ],
['0', '', '', "Output Control Options:" ],
['1', '-a', '--admin', "Adds advanced sys admin data (only works with
@@ -4494,9 +4565,13 @@ sub show_options {
hex (decimal) if greater than 9, otherwise hex; microcode - format: hex." ],
['2', '-d,-D', '', "If available: logical and physical block sizes; drive family;
USB drive specifics; SMART report." ],
- ['2', '-p,-P', '', "If available: raw size of partition, percent available for user,
- block size of file system (root required); for swap, shows swapiness and vfs cache
+ ['2', '-G', '', "If available: Xorg Display ID, Screens total, default Screen,
+ current Screen; per X Screen: resolution, dpi, size, diagonal; per Monitor:
+ resolution; hz; dpi; size; diagonal. See man for explanations." ],
+ ['2', '-j,-p,-P', '', "For swap (if available): swappiness and vfs cache
pressure, and if values are default or not." ],
+ ['2', '-p,-P', '', "If available: raw size of ${partition_string}s,
+ percent available for user, block size of file system (root required)." ],
['2', '-S', '', "If available: kernel boot parameters." ],
['1', '-A', '--audio', "Audio/sound card(s), driver, sound server." ],
['1', '-b', '--basic', "Basic output, short form. Same as $self_name^-v^2." ],
@@ -4518,19 +4593,23 @@ sub show_options {
['1', '-d', '--disk-full, --optical', "Optical drive data (and floppy disks,
if present). Triggers -D." ],
['1', '-D', '--disk', "Hard Disk info, including total storage and details
- for each disk. Disk total used percentage includes swap partition size(s)." ],
+ for each disk. Disk total used percentage includes swap ${partition_string}
+ size(s)." ],
['1', '-f', '--flags', "All CPU $flags. Triggers -C. Not shown with -F to
avoid spamming." ],
['1', '-F', '--full', "Full output. Includes all Upper Case line letters
- except -W, plus -s and -n. Does not show extra verbose options such
+ except -W, plus --swap, -s and -n. Does not show extra verbose options such
as -d -f -i -l -m -o -p -r -t -u -x, unless specified." ],
['1', '-G', '--graphics', "Graphics info (card(s), driver, display protocol
- (if available), display server, resolution, renderer, OpenGL version)." ],
+ (if available), display server/Wayland compositor, resolution, renderer,
+ OpenGL version)." ],
['1', '-i', '--ip', "WAN IP address and local interfaces (requires ifconfig
or ip network tool). Triggers -n. Not shown with -F for user security reasons.
You shouldn't paste your local/WAN IP." ],
['1', '-I', '--info', "General info, including processes, uptime, memory,
IRC client or shell type, $self_name version." ],
+ ['1', '-j', '--swap', "Swap in use. Includes ${partition_string}s, zram, file." ],
+ ['1', '-J', '--usb', "Show USB data: Hubs and Devices." ],
['1', '-l', '--label', "$partition_string_u labels. Triggers -P.
For full -p output, use -pl." ],
['1', '-m', '--memory', "Memory (RAM) data. Requires root. Numbers of
@@ -4555,7 +4634,8 @@ sub show_options {
['1', '-p', '--partitions-full', "Full $partition_string information (-P plus all other
detected ${partition_string}s)." ],
['1', '-P', '--partitions', "Basic $partition_string info. Shows, if detected:
- / /boot /home /opt /tmp /usr /usr/home /var /var/log /var/tmp. Use -p to see all
+ / /boot /home /opt /tmp /usr /usr/home /var /var/log /var/tmp. Swap
+ ${partition_string}s show if --swap is not used. Use -p to see all
mounted ${partition_string}s." ],
['1', '-r', '--repos', "Distro repository data. Supported repo types: APK,
APT, CARDS, EOPKG, PACMAN, PACMAN-G2, PISI, PORTAGE, PORTS (BSDs), SLACKPKG,
@@ -4573,7 +4653,6 @@ sub show_options {
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.^-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." ],
['1', '-v', '--verbosity', "Set $self_name verbosity level (0-8).
@@ -4588,10 +4667,11 @@ sub show_options {
['2', '4', '', "$partition_string_u size/used data (-P) for
(if present) /, /home, /var/, /boot. Shows full disk data (-D). " ],
['2', '5', '', "Audio card (-A), sensors (-s), memory/RAM (-m),
- $partition_string label^(-l), UUID^(-u), short form of optical drives,
- standard RAID data (-R). " ],
- ['2', '6', '', "Full $partition_string (-p), unmounted $partition_string (-o),
- optical drive (-d), USB (--usb), full RAID; triggers -xx." ],
+ $partition_string label^(-l), full swap (-j), UUID^(-u), short form
+ of optical drives, standard RAID data (-R). " ],
+ ['2', '6', '', "Full $partition_string (-p),
+ unmounted $partition_string (-o), optical drive (-d), USB (-J),
+ full RAID; triggers -xx." ],
['2', '7', '', "Network IP data (-i); triggers -xxx."],
['2', '8', '', "Everything available, including repos (-r), processes
(-tcm), PCI slots (--slots)."],
@@ -4638,6 +4718,7 @@ sub show_options {
['2', '-I', '', "Default system GCC. With -xx, also shows other installed
GCC versions. If running in shell, not in IRC client, shows shell version
number, if detected. Init/RC type and runlevel (if available)." ],
+ ['2', '-J', '', "For Device: driver." ],
['2', '-m,--memory-modules', '', "Max memory module size (if available), device type." ],
['2', '-N', '', "Specific vendor/product information (if relevant);
PCI Bus ID/USB ID number of card; Version/port(s)/driver version (if available)." ],
@@ -4649,7 +4730,6 @@ sub show_options {
and detected)" ],
['2', '-t', '', "Adds memory use output to CPU (-xt c), and CPU use to
memory (-xt m)." ],
- ['2', '--usb', '', "For Device: driver." ],
);
push @data, @rows;
if ( $use{'weather'} ){
@@ -4665,12 +4745,15 @@ sub show_options {
['2', '-C', '', "L1/L3 cache (if root and dmidecode installed)." ],
['2', '-D', '', "Disk transfer speed; NVMe lanes; Disk serial number." ],
['2', '-G', '', "Chip vendor:product ID for each video card; OpenGL
- compatibility version, if free drivers and available; compositor (experimental);
+ compatibility version, if free drivers and available; Xorg compositor;
alternate Xorg drivers (if available). Alternate means driver is on automatic
- driver check list of Xorg for the card vendor, but is not installed on system." ],
+ driver check list of Xorg for the card vendor, but is not installed on system;
+ Xorg dpi." ],
['2', '-I', '', "Other detected installed gcc versions (if present). System
default runlevel. Adds parent program (or tty) for shell info if not in
IRC. Adds Init version number, RC (if found)." ],
+ ['2', '-j,-p,-P', '', "Swap priority." ],
+ ['2', '-J', '', "Vendor:chip ID." ],
['2', '-m,--memory-modules', '', "Manufacturer, part number; single/double bank (if found)." ],
['2', '-M', '', "Chassis info, BIOS ROM size (dmidecode only), if available." ],
['2', '-N', '', "Chip vendor:product ID." ],
@@ -4681,7 +4764,6 @@ sub show_options {
gdm3, lightdm); active window manager if detected; desktop toolkit,
if available (Xfce/KDE/Trinity only)." ],
['2', '--slots', '', "Slot length." ],
- ['2', '--usb', '', "Vendor:chip ID." ],
);
push @data, @rows;
if ( $use{'weather'} ){
@@ -4697,9 +4779,10 @@ sub show_options {
['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', '', "Compositor version (if detectable)." ],
+ ['2', '-G', '', "Xorg Compositor version (if detectable)." ],
['2', '-I', '', "For 'Shell:' adds ([su|sudo|login]) to shell name if present;
for 'running in:' adds (SSH) if SSH session." ],
+ ['2', '-J', '', "For Device: serial number (if present), interface count; USB speed." ],
['2', '-m,--memory-modules', '', "Width of memory bus, data and total (if present and greater
than data); Detail for Type, if present; module voltage, if available; serial
number." ],
@@ -4710,7 +4793,6 @@ sub show_options {
['2', '-S', '', "Panel/tray/bar/dock info in desktop output, if in X (like lxpanel,
xfce4-panel, mate-panel); (if available) dm version number, window manager
version number." ],
- ['2', '--usb', '', "For Device: serial number (if present), interface count; USB speed." ],
);
push @data, @rows;
if ( $use{'weather'} ){
@@ -4723,8 +4805,12 @@ sub show_options {
settings or actual widths. Example:^inxi^-y^130" ],
['1', '-z', '--filter', "Adds security filters for IP/MAC addresses, serial numbers,
location (-w), user home directory name, host item. Default on for IRC clients." ],
+ ['1', '', '--filter-label', "Filters out ${partition_string} labels in -j,
+ -o, -p, -P, -Sa." ],
['1', '-Z', '--filter-override', "Override for output filters. Useful for
debugging networking issues in IRC, for example." ],
+ ['1', '', '--filter-uuid', "Filters out ${partition_string} UUIDs in -j,
+ -o, -p, -P, -Sa." ],
[0, '', '', "$line" ],
[0, '', '', "Additional Options:" ],
['1', '-h', '--help', "This help menu." ],
@@ -4759,6 +4845,7 @@ sub show_options {
['2', '43', '', "Bypass Wget as a downloader option." ],
['2', '44', '', "Bypass Curl, Fetch, and Wget as downloader options. Forces
Perl if HTTP::Tiny present." ],
+ ['1', '', '--dig', "Overrides configuration item NO_DIG (resets to default)." ],
['1', '', '--display', "[:[0-9]] Try to get display data out of X (default: display 0)." ],
['1', '', '--dmidecode', "Force use of dmidecode data instead of /sys where relevant
(e.g. -M, -B)." ],
@@ -4776,6 +4863,7 @@ sub show_options {
push @data, @rows;
}
@rows = (
+ ['1', '', '--no-dig', "Skip dig for WAN IP checks, use downloader program." ],
['1', '', '--no-host', "Turn off hostname for -S. Useful if showing output from servers etc." ],
);
push @data, @rows;
@@ -4787,14 +4875,14 @@ sub show_options {
}
@rows = (
['1', '', '--no-ssl', "Skip SSL certificate checks for all downloader actions
- (Wget/Fetch/Curl only)." ],
+ (Wget/Fetch/Curl/Perl-HTTP::Tiny)." ],
['1', '', '--no-sudo', "Skip internal program use of sudo features (not related
to starting $self_name with sudo)." ],
['1', '', '--output', "[json|screen|xml] Change data output type. Requires --output-file
if not screen." ],
['1', '', '--output-file', "[Full filepath|print] Output file to be used for --output." ],
['1', '', '--partition-sort', "[dev-base|fs|id|label|percent-used|size|uuid|used]
- Change sort order of partition output. See man page for specifics." ],
+ Change sort order of ${partition_string} output. See man page for specifics." ],
['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" ],
@@ -5289,6 +5377,19 @@ sub apply_filter {
}
return $string;
}
+# note, let the print logic handle N/A cases
+sub apply_partition_filter {
+ my ($source,$string,$type) = @_;
+ return $string if !$string || $string eq 'N/A';
+ if ($source eq 'system') {
+ my $test = ($type eq 'label') ? '=LABEL=': '=UUID=';
+ $string =~ s/$test[^\s]+/$test$filter_string/g;
+ }
+ else {
+ $string = $filter_string;
+ }
+ return $string;
+}
sub arm_cleaner {
my ($item) = @_;
$item =~ s/(\([^\(]*Device Tree[^\)]*\))//gi;
@@ -5471,6 +5572,7 @@ sub row_defaults {
'disk-data' => "No Disk data was found.",
'disk-size-0' => "Total N/A",
'display-console' => 'No advanced graphics data found on this system in console.',
+ 'display-driver-na' => "display driver n/a",
'display-null' => 'No advanced graphics data found on this system.',
'display-root' => 'Advanced graphics data unavailable in console for root.',
'display-root-x' => 'Advanced graphics data unavailable for root.',
@@ -5481,7 +5583,8 @@ sub row_defaults {
'dev' => 'Feature under development',
'dmesg-boot-permissions' => 'dmesg.boot permissions',
'dmesg-boot-missing' => 'dmesg.boot not found',
- 'IP' => "No $id data found. Connected to the web? SSL issues?",
+ 'IP' => "No $id found. Connected to web? SSL issues?",
+ 'IP-dig' => "No $id found. Connected to web? SSL issues? Try --no-dig",
'machine-data' => "No machine data: try newer kernel.",
'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.",
@@ -5500,6 +5603,7 @@ sub row_defaults {
'raid-data' => "No RAID data was found.",
'ram-data' => "No RAM data was found.",
'root-required' => "<superuser/root required>",
+ 'root-suggested' => "try sudo/root",
'sensors-data-ipmi' => "No ipmi sensors data was found.",
'sensors-data-linux' => "No sensors data was found. Is sensors configured?",
'sensors-ipmi-root' => "Unable to run ipmi sensors. Root privileges required.",
@@ -5508,6 +5612,8 @@ sub row_defaults {
'smartctl-udma-crc' => "Bad cable/connection?",
'smartctl-usb' => "Unknown USB bridge. Flash drive/Unsupported enclosure?",
'smartctl-unknown' => "Unknown smartctl error. Unable to get data.",
+ 'swap-admin' => "No admin swap data available.",
+ 'swap-data' => "No Swap data was found.",
'tool-missing' => "<missing $id>",
'unmounted-data' => "No unmounted partitions found.",
'unmounted-data-bsd' => "No unmounted partition data found for this BSD system.",
@@ -5749,6 +5855,7 @@ sub print_data {
my $hash = 0;
my $holder = '';
my $id_holder = 0;
+ my $screen_holder = 0;
my $start = '';
my $start2 = '';
my $length = 0;
@@ -5788,7 +5895,9 @@ sub print_data {
'Hardware' => 1, # hardware raid report
'ID' => 1,
'IF-ID' => 1,
+ 'Monitor' => 1,
'Optical' => 1,
+ 'Screen' => 1,
'variant' => 1, # arm > 1 cpu type
);
$array_holder = 1;
@@ -5813,6 +5922,11 @@ sub print_data {
$id_holder = $ids{$key};
$ids{'array'} = 1 if ($ids{'array'} > 1);
}
+ # new Screen
+ if ($key eq 'Screen' && $screen_holder != $ids{$key} ){
+ $screen_holder = $ids{$key};
+ $ids{'Monitor'} = 1 if ($ids{'Monitor'} > 1);
+ }
if ($counter == 0 && defined $ids{$key}){
$key .= '-' . $ids{$key}++;
}
@@ -7997,7 +8111,11 @@ sub cpu_arch {
elsif ($family eq '17'){
if ( $model =~ /^(1|11)$/ ) {$arch = 'Zen'}
elsif ( $model =~ /^(8|18)$/ ) {$arch = 'Zen+'}
- elsif ( $model =~ /^2[0123456789ABCDEF]$/ ) {$arch = 'Zen 2'}
+ # not positive about 2x, main resource shows only 31 and 71 hex
+ elsif ( $model =~ /^(2[0123456789ABCDEF]|31|71)$/ ) {$arch = 'Zen 2'}
+ # no info on these yet, but they are coming and are scheduled
+ # elsif ( $model =~ /^()$/ ) {$arch = 'Zen 3'}
+ # elsif ( $model =~ /^()$/ ) {$arch = 'Zen 4'}
else {$arch = 'Zen'}
}
elsif ($family eq '18'){
@@ -8101,7 +8219,8 @@ sub cpu_arch {
elsif ($model eq '8E' && ($stepping == 11 || $stepping == 12)){$arch = 'Whiskey Lake'}
elsif ($model eq '8E' && $stepping == 9){$arch = 'Amber Lake'}
elsif ($stepping > 13){$arch = 'Comet Lake'} # guess, have not seen docs yet
- elsif ($stepping > 9){$arch = 'Coffee Lake'}
+ # elsif ($stepping > 9 && $stepping < 14){$arch = 'Coffee Lake'}
+ # NOTE: kaby lake is 8E 9 but so is Amber Lake
else {$arch = 'Kaby Lake'} }
#elsif ( $model =~ /^(9E)$/ ) {$arch = 'Coffee Lake'}
elsif ( $model =~ /^(57)$/ ) {$arch = 'Knights Landing'}
@@ -8506,6 +8625,8 @@ sub disk_data {
# don't count remote used, also, some cases mount
# panfs is parallel NAS volume manager, need more data
next if ($row{'fs'} && $row{'fs'} =~ /cifs|iso9660|nfs|panfs|sshfs|smbfs|unionfs/);
+ # don't count zfs or file type swap
+ next if ($row{'swap-type'} && $row{'swap-type'} ne 'partition');
# in some cases, like redhat, mounted cdrom/dvds show up in partition data
next if ($row{'dev-base'} && $row{'dev-base'} =~ /^sr[0-9]+$/);
# this is used for specific cases where bind, or incorrect multiple mounts
@@ -9394,7 +9515,7 @@ sub device_vendor {
# $model = 'Patriot Memory';
my @vendors = (
## These go first because they are the most likely and common ##
- ['(Crucial|^(FC)?CT|-CT|^M4\b)','Crucial','Crucial',''],
+ ['(Crucial|^(FC)?CT|-CT|^M4\b|Gizmo!)','Crucial','Crucial',''],
['^(INTEL|SSD(PAM|SA2))','^INTEL','Intel',''],
['(KINGSTON|DataTraveler|DT\s?(DUO|Microduo|101)|^SMS|^SHS|^SUV|^Ultimate CF|HyperX|^S[AV][34]00)','KINGSTON','Kingston',''], # maybe SHS: SHSS37A SKC SUV
# must come before samsung MU. NOTE: toshiba can have: TOSHIBA_MK6475GSX: mush: MKNSSDCR120GB_
@@ -9418,7 +9539,7 @@ sub device_vendor {
['^(Corsair|Force\s|(Flash\s*)?(Survivor|Voyager))','^Corsair','Corsair',''],
['^(FUJITSU|MJA|MH[TVWYZ][0-9]|MP|MAP[0-9])','^FUJITSU','Fujitsu',''],
# note: 2012: wdc bought hgst
- ['^(HGST|Touro|5450)','^HGST','HGST (Hitachi)',''], # HGST HUA
+ ['^(HGST|Touro|54[15]0|7250)','^HGST','HGST (Hitachi)',''], # HGST HUA
['^(Hitachi|HCS|HD[PST]|DK[0-9]|IC|HT|HU)','^Hitachi','Hitachi',''],
# vb: VB0250EAVER but clashes with vbox; HP_SSD_S700_120G ;GB0500EAFYL GB starter too generic?
# DX110064A5xnNMRI ids as HP and Sandisc, same ID, made by sandisc for hp? not sure
@@ -9427,9 +9548,9 @@ sub device_vendor {
# OCZSSD2-2VTXE120G is OCZ-VERTEX2_3.5
['^(OCZ|APOC|D2|DEN|DEN|DRSAK|EC188|FTNC|GFGC|MANG|MMOC|NIMC|NIMR|PSIR|RALLY2|TALOS2|TMSC|TRSAK)','^OCZ[\s-]','OCZ',''],
['^OWC','^OWC[\s-]','OWC',''],
- ['^Philips','^Philips','Philips',''],
+ ['^(Philips|GoGear)','^Philips','Philips',''],
['^PIONEER','^PIONEER','Pioneer',''],
- ['^PNY','^PNY\s','PNY','','^PNY'],
+ ['^(PNY|Hook\s?Attache)','^PNY\s','PNY','','^PNY'],
# note: get rid of: M[DGK] becasue mushkin starts with MK
# note: seen: KXG50ZNV512G NVMe TOSHIBA 512GB | THNSN51T02DUK NVMe TOSHIBA 1024GB
['(^[S]?TOS|^THN|TOSHIBA|TransMemory|^M[KQ][0-9])','[S]?TOSHIBA','Toshiba',''], # scsi-STOSHIBA_STOR.E_EDITION_
@@ -9450,6 +9571,7 @@ sub device_vendor {
['^(ASM|2115)','^ASM','ASMedia',''],#asm1153e
['^(AVEXIR|AVSSD)','^AVEXIR','Avexir',''],
['^Bell\b','^Bell','Packard Bell',''],
+ ['^(BelovedkaiAE|GhostPen)','^BelovedkaiAE','BelovedkaiAE',''],
['^BHT','^BHT','BHT',''],
['^BIOSTAR','^BIOSTAR','Biostar',''],
['^BIWIN','^BIWIN','BIWIN',''],
@@ -9461,6 +9583,7 @@ sub device_vendor {
['^CHN\b','','Zheino',''],
['^Clover','^Clover','Clover',''],
['^Colorful\b','^Colorful','Colorful',''],
+ ['^CnMemory|Spaceloop','^CnMemory','CnMemory',''],
['^CSD','^CSD','CSD',''],
['^(Dane-?Elec|Z Mate)','^Dane-?Elec','DaneElec',''],
# Daplink vfs is an ARM software thing
@@ -9504,6 +9627,7 @@ sub device_vendor {
['^(IBM|DT)','^IBM','IBM',''],
['^IEI Tech','^IEI Tech(\.|nology)?( Corp(\.|oration)?)?','IEI Technology',''],
['^(Imation|Nano\s?Pro|HQT)','^Imation(\sImation)?','Imation',''], # Imation_ImationFlashDrive; TF20 is imation/tdk
+ ['^(Inca\b|Npenterprise)','^Inca','Inca',''],
['^(InnoDisk|Innolite)','^InnoDisk( Corp.)?','InnoDisk',''],
['^Innostor','^Innostor','Innostor',''],
['^Innovation','^Innovation','Innovation',''],
@@ -9523,7 +9647,8 @@ sub device_vendor {
# kingwin docking, not actual drive
['^(EZD|EZ-Dock)','','Kingwin Docking Station',''],
['^KLEVV','^KLEVV','KLEVV',''],
- ['^(Lacie|P92)','^Lacie','Lacie',''],
+ ['^(Lacie|P92|itsaKey|iamaKey)','^Lacie','LaCie',''],
+ ['^LANBO','^LANBO','LANBO',''],
['^LDLC','^LDLC','LDLC',''],
# LENSE30512GMSP34MEAT3TA
['^LEN','^Lenovo','Lenovo',''],
@@ -9533,7 +9658,7 @@ sub device_vendor {
['^(LITE[-\s]?ON|PH[1-9])','^LITE[-]?ON','LITE-ON',''], # PH6-CE240-L
['^LONDISK','^LONDISK','LONDISK',''],
['^M-Systems','^M-Systems','M-Systems',''],
- ['^(Mach\s*Xtreme|MXSSD)','^Mach\s*Xtreme','Mach Xtreme',''],
+ ['^(Mach\s*Xtreme|MXSSD|MXU)','^Mach\s*Xtreme','Mach Xtreme',''],
['^(MAXTOR|Atlas|TM[0-9]{4})','^MAXTOR','Maxtor',''], # note M2 M3 is usually maxtor, but can be samsung
['^(Memorex|TravelDrive|TD\s?Classic)','^Memorex','Memorex',''],
# note: C300/400 can be either micron or crucial, but C400 is M4 from crucial
@@ -9604,7 +9729,7 @@ sub device_vendor {
['^(TDK|TF[1-9][0-9])','^TDK','TDK',''],
['^TEAC','^TEAC','TEAC',''],
['^TEAM','^TEAM( Group)?','Team',''],
- ['^Teclast','^Teclast','Teclast',''],
+ ['^(Teclast|CoolFlash)','^Teclast','Teclast',''],
['^Teleplan','^Teleplan','Teleplan',''],
['^TEUTONS','^TEUTONS','TEUTONS',''],
['^Tigo','^Tigo','Tigo',''],
@@ -9817,7 +9942,8 @@ sub set_glabel {
## GraphicData
{
package GraphicData;
-my $driver = ''; # we need this as a fallback in case no xorg.0.log
+my $driver = ''; # we need this as a fallback in case no xorg log found
+my %graphics;
sub get {
eval $start if $b_log;
my (@data,@rows);
@@ -9845,6 +9971,9 @@ sub get {
@rows = (@rows,@data);
}
}
+ # note: not perfect, but we need usb gfx to show for all types, soc, pci, etc
+ @data = usb_data();
+ @rows = (@rows,@data);
@data = display_data();
@rows = (@rows,@data);
@data = gl_data();
@@ -9904,131 +10033,70 @@ sub card_data {
eval $end if $b_log;
return @rows;
}
-sub display_data(){
+sub usb_data {
eval $start if $b_log;
- my (%graphics,@row);
- my @xdpyinfo;
- my $num = 0;
- my ($protocol,$server) = ('','');
- # note: these may not always be set, they won't be out of X, for example
- $protocol = $ENV{'XDG_SESSION_TYPE'} if $ENV{'XDG_SESSION_TYPE'};
- $protocol = $ENV{'WAYLAND_DISPLAY'} if (!$protocol && $ENV{'WAYLAND_DISPLAY'});
- # yes, I've seen this in 2019 distros, sigh
- $protocol = '' if $protocol eq 'tty';
- # need to confirm that there's a point to this test, I believe no, fails out of x
- # loginctl also results in the session id
- if (!$protocol && $b_display && $b_force_display){
- if (my $program = main::check_program('loginctl')){
- my $id = '';
- # $id = $ENV{'XDG_SESSION_ID'}; # returns tty session in console
- my @data = main::grabber("$program --no-pager --no-legend 2>/dev/null",'','strip');
- foreach (@data){
- next if /tty[v]?[0-6]$/; # freebsd: ttyv3
- $id = (split /\s+/, $_)[0];
- last; # multiuser? too bad, we'll go for the first one
- }
- if ($id ){
- my $temp = (main::grabber("$program show-session $id -p Type --no-pager --no-legend 2>/dev/null"))[0];
- $temp =~ s/Type=// if $temp;
- # ssh will not show /dev/ttyx so would have passed the first test
- $protocol = $temp if $temp && $temp ne 'tty';
- }
- }
- }
- if ($extra > 1){
- # initial tests, if wayland, it is certainly a compositor
- $protocol = lc($protocol) if $protocol;
- $graphics{'compositor'} = display_compositor($protocol);
- # gnome-shell is incredibly slow to return version
- if ($extra > 2 && $graphics{'compositor'} && (!$show{'system'} || $graphics{'compositor'} ne 'gnome-shell' ) ){
- $graphics{'compositor-version'} = (main::program_data($graphics{'compositor'},$graphics{'compositor'},3))[1];
- }
- }
- if ( $b_display){
- # X vendor and version detection.
- # new method added since radeon and X.org and the disappearance of
- # <X server name> version : ...etc. Later on, the normal textual version string
- # returned, e.g. like: X.Org version: 6.8.2
- # A failover mechanism is in place: if $version empty, release number parsed instead
- if (my $program = main::check_program('xdpyinfo')){
- my @xdpyinfo = main::grabber("$program $display_opt 2>/dev/null","\n",'strip');
- #@xdpyinfo = map {s/^\s+//;$_} @xdpyinfo if @xdpyinfo;
- #print join "\n",@xdpyinfo, "\n";
- foreach (@xdpyinfo){
- my @working = split /:\s+/, $_;
- next if ( ($graphics{'dimensions'} && $working[0] ne 'dimensions' ) || !$working[0] );
- #print "$_\n";
- if ($working[0] eq 'vendor string'){
- $working[1] =~ s/The\s|\sFoundation//g;
- # some distros, like fedora, report themselves as the xorg vendor,
- # so quick check here to make sure the vendor string includes Xorg in string
- if ($working[1] !~ /x/i){
- $working[1] .= ' X.org';
- }
- $graphics{'vendor'} = $working[1];
- }
- elsif ($working[0] eq 'version number'){
- $graphics{'version-id'} = $working[1];
- }
- elsif ($working[0] eq 'vendor release number'){
- $graphics{'vendor-release'} = $working[1];
- }
- elsif ($working[0] eq 'X.Org version'){
- $graphics{'xorg-version'} = $working[1];
+ my (@rows,@data,@ids,$driver,$path_id,$product,@temp2);
+ my ($j,$num) = (0,1);
+ return if !@usb;
+ foreach my $ref (@usb){
+ my @row = @$ref;
+ # these tests only work for /sys based usb data for now
+ if ($row[14] && ($row[14] eq 'Audio-Video' || $row[14] eq 'Video' ) ){
+ $num = 1;
+ $j = scalar @rows;
+ # makre sure to reset, or second device trips last flag
+ ($driver,$path_id,$product) = ('','','');
+ $product = main::cleaner($row[13]) if $row[13];
+ $driver = $row[15] if $row[15];
+ $path_id = $row[2] if $row[2];
+ $product ||= 'N/A';
+ # note: for real usb video out, no generic drivers? webcams may have one though
+ if (!$driver){
+ if ($row[14] eq 'Audio-Video'){
+ $driver = 'N/A';
}
- elsif ($working[0] eq 'dimensions'){
- $working[1] =~ s/\spixels//;
- $working[1] =~ s/\smillimeters/ mm/;
- if ($graphics{'dimensions'}){
- $graphics{'dimensions'} = ([@{$graphics{'dimensions'}},$working[1]]);
- }
- else {
- $graphics{'dimensions'} = ([$working[1]]);
- }
+ else {
+ $driver = 'N/A';
}
}
- #$graphics{'dimensions'} = (\@dimensions);
- # we get a bit more info from xrandr than xdpyinfo, but xrandr fails to handle
- # multiple screens from different video cards
- my $ref = $graphics{'dimensions'};
- if (defined $ref){
- my @screens = @$ref;
- my $resolution;
- if (scalar @screens == 1){
- if (my $program = main::check_program('xrandr')){
- my $counter = 0;
- my @xrandr = main::grabber("$program $display_opt 2>/dev/null",'','strip');
- foreach (@xrandr){
- $counter++;
- if (/^[^\s]+\sconnected\s(primary\s)?([0-9]+)\s*x\s*([0-9]+)\+/){
- $resolution = $2 . 'x' . $3 if $2 && $3;
- }
- my @working = split /\s+/,$_;
- # print join "$_\n";
- if ($working[1] =~ /\*/){
- $working[1] =~ s/\*|\+//g;
- $working[1] = sprintf("%.0f",$working[1]);
- $working[1] = ($working[1]) ? "$working[1]Hz" : 'N/A';
- # case where 0 is 'preferred, sigh.
- $working[0] = ($working[0] !~ /[0-9]\s*x\s*[0-9]/ && $resolution) ? $resolution : $working[0];
- my $screen = "$working[0]~$working[1]";
- if ($graphics{'screens'}){
- $graphics{'screens'} = ([@{$graphics{'screens'}},$screen]);
- }
- else {
- $graphics{'screens'} = ([$screen]);
- }
- }
- }
- }
- }
+ @data = ({
+ main::key($num++,'Device') => $product,
+ main::key($num++,'type') => 'USB',
+ main::key($num++,'driver') => $driver,
+ },);
+ @rows = (@rows,@data);
+ if ($extra > 0){
+ $rows[$j]{main::key($num++,'bus ID')} = "$path_id:$row[1]";
}
- else {
- $graphics{'tty'} = tty_data();
+ if ($extra > 1){
+ $row[7] ||= 'N/A';
+ $rows[$j]{main::key($num++,'chip ID')} = $row[7];
+ }
+ if ($extra > 2 && $row[16]){
+ $rows[$j]{main::key($num++,'serial')} = main::apply_filter($row[16]);
}
}
- else {
- $graphics{'screens'} = ([main::row_defaults('xdpyinfo-missing')]);
+ }
+ eval $end if $b_log;
+ return @rows;
+}
+sub display_data(){
+ eval $start if $b_log;
+ my (@row);
+ my ($num,$protocol) = (0,'');
+ # note: these may not always be set, they won't be out of X, for example
+ $protocol = get_protocol();
+ # note, since the compositor is the server with wayland, always show it
+ if ($extra > 1 || $protocol eq 'wayland'){
+ set_compositor($protocol);
+ }
+ if ( $b_display){
+ x_display_data();
+ # currently a stub, wayland needs a lot more work
+ if ($protocol && $protocol eq 'wayland' && !$graphics{'screens'}){
+ wayland_display_data();
+ # it worked! we got screen data
+ $graphics{'no-xdpyinfo'} = undef if $graphics{'screens'};
}
}
else {
@@ -10036,38 +10104,29 @@ sub display_data(){
}
# this gives better output than the failure last case, which would only show:
# for example: X.org: 1.9 instead of: X.org: 1.9.0
- $graphics{'version'} = $graphics{'xorg-version'} if $graphics{'xorg-version'};;
- $graphics{'version'} = x_version() if !$graphics{'version'};
- $graphics{'version'} = $graphics{'version-id'} if !$graphics{'version'};
-
- undef @xdpyinfo;
+ $graphics{'x-version'} = $graphics{'xorg-version'} if $graphics{'xorg-version'};;
+ $graphics{'x-version'} = x_version() if !$graphics{'x-version'};
+ $graphics{'x-version'} = $graphics{'x-version-id'} if !$graphics{'x-version'};
#print Data::Dumper::Dumper \%graphics;
if (%graphics){
- my $resolution = '';
- my $server_string = '';
- if ($graphics{'vendor'}){
- my $version = ($graphics{'version'}) ? " $graphics{'version'}" : '';
- $server_string = "$graphics{'vendor'}$version";
- }
- elsif ($graphics{'version'}) {
- if ($graphics{'version'} =~ /^Xvesa/){
- $server_string = $graphics{'version'};
+ my ($driver_missing,$resolution,$server_string) = ('','','');
+ # print "$graphics{'x-vendor'} $graphics{'x-version'} $graphics{'x-vendor-release'}","\n";
+ if ($graphics{'x-vendor'}){
+ my $version = ($graphics{'x-version'}) ? " $graphics{'x-version'}" : '';
+ #$version = (!$version && $graphics{'x-vendor-release'}) ? " $graphics{'x-vendor-release'}" : '';
+ $server_string = "$graphics{'x-vendor'}$version";
+ #print "$server_string\n";
+ }
+ elsif ($graphics{'x-version'}) {
+ if ($graphics{'x-version'} =~ /^Xvesa/){
+ $server_string = $graphics{'x-version'};
}
else {
- $server_string = "X.org $graphics{'version'}";
- }
- }
- if ($graphics{'screens'}){
- my $ref = $graphics{'screens'};
- my @screens = @$ref;
- my $sep = '';
- foreach (@screens){
- $resolution .= $sep . $_;
- $sep = ', ';
+ $server_string = "X.org $graphics{'x-version'}";
}
}
my @drivers = x_drivers();
- if (!$protocol && !$server_string && !$graphics{'vendor'} && !@drivers){
+ if (!$protocol && !$server_string && !$graphics{'x-vendor'} && !@drivers){
$server_string = main::row_defaults('display-server');
@row = ({
main::key($num++,'Display') => '',
@@ -10076,15 +10135,44 @@ sub display_data(){
}
else {
$server_string ||= 'N/A';
- # note: if no xorg log, and if wayland, there will be no xorg drivers,
- # obviously, so we use the last driver found on the card section in that case.
- # those come from lscpi kernel drivers so there should be no xorg/wayland issues.
- $driver = ($drivers[0]) ? $drivers[0]: $driver;
@row = ({
main::key($num++,'Display') => $protocol,
main::key($num++,'server') => $server_string,
- main::key($num++,'driver') => $driver,
});
+ if ($graphics{'compositor'}){
+ $row[0]{main::key($num++,'compositor')} = $graphics{'compositor'};
+ if ($graphics{'compositor-version'}){
+ $row[0]{main::key($num++,'v')} = $graphics{'compositor-version'};
+ }
+ }
+ # note: if no xorg log, and if wayland, there will be no xorg drivers,
+ # obviously, so we use the last driver found on the card section in that case.
+ # those come from lscpi kernel drivers so there should be no xorg/wayland issues.
+ if (!$drivers[0]){
+ # Fallback: specific case: in Arch/Manjaro gdm run systems, their Xorg.0.log is
+ # located inside this directory, which is not readable unless you are root
+ # Normally Arch gdm log is here: ~/.local/share/xorg/Xorg.1.log
+ # $driver comes from the Device lines, and is just last fallback.
+ if ($driver){
+ if (-e '/var/lib/gdm' && !$b_root ){
+ $driver_missing = main::row_defaults('display-driver-na') . ' - ' . main::row_defaults('root-suggested');
+ }
+ else {
+ $driver_missing = main::row_defaults('display-driver-na');
+ }
+ }
+ else {
+ $driver_missing = main::row_defaults('root-suggested') if -e '/var/lib/gdm' && !$b_root;
+ }
+ }
+ else {
+ $driver = $drivers[0];
+ }
+ $driver ||= 'N/A';
+ $row[0]{main::key($num++,'driver')} = $driver;
+ if ($driver_missing){
+ $row[0]{main::key($num++,'note')} = $driver_missing;
+ }
if ($drivers[2]){
$row[0]{main::key($num++,'FAILED')} = $drivers[2];
}
@@ -10094,16 +10182,116 @@ sub display_data(){
if ($extra > 1 && $drivers[3]){
$row[0]{main::key($num++,'alternate')} = $drivers[3];
}
- if ($graphics{'compositor'}){
- $row[0]{main::key($num++,'compositor')} = $graphics{'compositor'};
- if ($graphics{'compositor-version'}){
- $row[0]{main::key($num++,'v')} = $graphics{'compositor-version'};
+ }
+ if ($b_admin ){
+ if ($graphics{'x-display-id'}){
+ $row[0]{main::key($num++,'display ID')} = $graphics{'x-display-id'};
+ }
+ if (defined $graphics{'x-screens'}){
+ $row[0]{main::key($num++,'screens')} = $graphics{'x-screens'};
+ }
+ if (defined $graphics{'x-default-screen'} && $graphics{'x-screens'} && $graphics{'x-screens'} > 1){
+ $row[0]{main::key($num++,'default screen')} = $graphics{'x-default-screen'};
+ }
+ }
+ if ($graphics{'no-xdpyinfo'}){
+ $row[0]{main::key($num++,'resolution')} = $graphics{'no-xdpyinfo'};
+ }
+ elsif ($graphics{'screens'}){
+ my ($diag,$dpi,$hz,$size);
+ my ($m_count,$basic_count,$row_key,$screen_count) = (0,0,0,0);
+ my $s_count = ($graphics{'screens'}) ? scalar @{$graphics{'screens'}}: 0;
+ foreach (@{$graphics{'screens'}}){
+ my %main = %$_;
+ $m_count = scalar @{$main{'monitors'}} if $main{'monitors'};
+ $screen_count++;
+ ($diag,$dpi,$hz,$resolution,$size) = (undef);
+ $row_key++ if !$show{'graphic-basic'};
+ if ( !$show{'graphic-basic'} || $m_count == 0 ){
+ if ( !$show{'graphic-basic'} && defined $main{'screen'} ){
+ $row[$row_key]{main::key($num++,'Screen')} = $main{'screen'};
+ }
+ $resolution = $main{'res-x'} . 'x' . $main{'res-y'} if $main{'res-x'} && $main{'res-y'};
+ $resolution .= '~' . $main{'hz'} . 'Hz' if $show{'graphic-basic'} && $main{'hz'} && $resolution;
+ $resolution ||= 'N/A';
+ if ($s_count == 1 || !$show{'graphic-basic'}){
+ $row[$row_key]{main::key($num++,'s-res')} = $resolution;
+ }
+ elsif ($show{'graphic-basic'}) {
+ $row[$row_key]{main::key($num++,'s-res')} = '' if $screen_count == 1;
+ $row[$row_key]{main::key($num++,$screen_count)} = $resolution;
+ }
+ $resolution = '';
+ if ($main{'s-dpi'} && (!$show{'graphic-basic'} || $extra > 1)){
+ $row[$row_key]{main::key($num++,'s-dpi')} = $main{'s-dpi'};
+ }
+ if ( !$show{'graphic-basic'} ){
+ if ($main{'size-x'} && $main{'size-y'}){
+ $size = $main{'size-x'} . 'x' . $main{'size-y'} .
+ 'mm ('. $main{'size-x-i'} . 'x' . $main{'size-y-i'} . '")';
+ }
+ $size ||= '';
+ $row[$row_key]{main::key($num++,'s-size')} = $size if $size;
+ if ($main{'diagonal'}){
+ $diag = $main{'diagonal-m'} . 'mm ('. $main{'diagonal'} . '")';
+ }
+ $diag ||= '';
+ $row[$row_key]{main::key($num++,'s-diag')} = $diag if $diag;
+ }
+ }
+ if ($main{'monitors'}){
+ #print $basic_count . '::' . $m_count, "\n";
+ foreach my $ref2 (@{$main{'monitors'}}){
+ my %monitor = %$ref2;
+ ($diag,$dpi,$hz,$resolution,$size) = (undef);
+ if ($show{'graphic-basic'}){
+ $basic_count++;
+ if ($monitor{'res-x'} && $monitor{'res-y'}){
+ $resolution = $monitor{'res-x'} . 'x' . $monitor{'res-y'};
+ }
+ # using main, noit monitor, dpi because we want xorg dpi, not physical screen dpi
+ $dpi = $main{'s-dpi'} if $resolution && $extra > 1 && $main{'s-dpi'};
+ $resolution .= '~' . $monitor{'hz'} . 'Hz' if $monitor{'hz'} && $resolution;
+ $resolution ||= 'N/A';
+ if ($basic_count == 1 && $m_count == 1){
+ $row[$row_key]{main::key($num++,'resolution')} = $resolution;
+ }
+ else {
+ $row[$row_key]{main::key($num++,'resolution')} = '' if $basic_count == 1;
+ $row[$row_key]{main::key($num++,$basic_count)} = $resolution;
+ }
+ if ($m_count == $basic_count){
+ $row[$row_key]{main::key($num++,'s-dpi')} = $dpi if $dpi;
+ }
+ next;
+ }
+ $row_key++;
+ $row[$row_key]{main::key($num++,'Monitor')} = $monitor{'monitor'};
+ if ($monitor{'res-x'} && $monitor{'res-y'}){
+ $resolution = $monitor{'res-x'} . 'x' . $monitor{'res-y'};
+ }
+ $resolution ||= 'N/A';
+ $row[$row_key]{main::key($num++,'res')} = $resolution;
+ $hz = ($monitor{'hz'}) ? $monitor{'hz'} : '';
+ $row[$row_key]{main::key($num++,'hz')} = $hz if $hz;
+ $dpi = ($monitor{'dpi'}) ? $monitor{'dpi'} : '';
+ $row[$row_key]{main::key($num++,'dpi')} = $dpi if $dpi;
+ #print "$dpi :: $main{'s-dpi'}\n";
+ if ($monitor{'size-x'} && $monitor{'size-y'}){
+ $size = $monitor{'size-x'} . 'x' . $monitor{'size-y'} .
+ 'mm ('. $monitor{'size-x-i'} . 'x' . $monitor{'size-y-i'} . '")';
+ }
+ $size ||= '';
+ $row[$row_key]{main::key($num++,'size')} = $size if $size;
+ if ($monitor{'diagonal'}){
+ $diag = $monitor{'diagonal-m'} . 'mm ('. $monitor{'diagonal'} . '")';
+ }
+ $diag ||= '';
+ $row[$row_key]{main::key($num++,'diag')} = $diag if $diag;
+ }
}
}
}
- if ($resolution){
- $row[0]{main::key($num++,'resolution')} = $resolution;
- }
else {
$graphics{'tty'} ||= 'N/A';
$row[0]{main::key($num++,'tty')} = $graphics{'tty'};
@@ -10112,6 +10300,232 @@ sub display_data(){
eval $end if $b_log;
return @row;
}
+
+sub x_display_data {
+ eval $start if $b_log;
+ # X vendor and version detection.
+ # new method added since radeon and X.org and the disappearance of
+ # <X server name> version : ...etc. Later on, the normal textual version string
+ # returned, e.g. like: X.Org version: 6.8.2
+ # A failover mechanism is in place: if $version empty, release number parsed instead
+ if (my $program = main::check_program('xdpyinfo')){
+ my ($diagonal,$diagonal_m,$dpi) = ('','','');
+ my ($screen_id,$screen,@working);
+ my ($res_x,$res_x_i,$res_y,$res_y_i,$size_x,$size_x_i,$size_y,$size_y_i);
+ my @xdpyinfo = main::grabber("$program $display_opt 2>/dev/null","\n",'strip');
+ #@xdpyinfo = map {s/^\s+//;$_} @xdpyinfo if @xdpyinfo;
+ #print join "\n",@xdpyinfo, "\n";
+ foreach (@xdpyinfo){
+ @working = split /:\s+/, $_;
+ next if ( ($graphics{'screens'} && $working[0] !~ /^(dimensions$|screen\s#)/ ) || !$working[0] );
+ #print "$_\n";
+ if ($working[0] eq 'vendor string'){
+ $working[1] =~ s/The\s|\sFoundation//g;
+ # some distros, like fedora, report themselves as the xorg vendor,
+ # so quick check here to make sure the vendor string includes Xorg in string
+ if ($working[1] !~ /x/i){
+ $working[1] .= ' X.org';
+ }
+ $graphics{'x-vendor'} = $working[1];
+ }
+ elsif ($working[0] eq 'name of display'){
+ $graphics{'x-display-id'} = $working[1];
+ }
+ elsif ($working[0] eq 'version number'){
+ $graphics{'x-version-id'} = $working[1];
+ }
+ # note used, fix that
+ elsif ($working[0] eq 'vendor release number'){
+ $graphics{'x-vendor-release'} = $working[1];
+ }
+ elsif ($working[0] eq 'X.Org version'){
+ $graphics{'xorg-version'} = $working[1];
+ }
+ elsif ($working[0] eq 'default screen number'){
+ $graphics{'x-default-screen'} = $working[1];
+ }
+ elsif ($working[0] eq 'number of screens'){
+ $graphics{'x-screens'} = $working[1];
+ }
+ elsif ($working[0] =~ /^screen #([0-9]+):/){
+ $screen_id = $1;
+ $graphics{'screens'} = () if !$graphics{'screens'};
+ }
+ elsif ($working[0] eq 'resolution'){
+ $working[1] =~ s/^([0-9]+)x/$1/;
+ $graphics{'s-dpi'} = $working[1];
+ }
+ elsif ($working[0] eq 'dimensions'){
+ ($dpi,$res_x,$res_y,$size_x,$size_y) = (undef,undef,undef,undef,undef);
+ if ($working[1] =~ /([0-9]+)\s*x\s*([0-9]+)\s+pixels\s+\(([0-9]+)\s*x\s*([0-9]+)\s*millimeters\)/){
+ $res_x = $1;
+ $res_y = $2;
+ $size_x = $3;
+ $size_y = $4;
+ $res_x_i = ($1) ? sprintf("%.1f", ($1/25.4)) : 0;
+ $res_y_i = ($2) ? sprintf("%.1f", ($2/25.4)) : 0;
+ $size_x_i = ($3) ? sprintf("%.1f", ($3/25.4)) : 0;
+ $size_y_i = ($4) ? sprintf("%.1f", ($4/25.4)) : 0;
+ $dpi = ($res_x && $size_x) ? sprintf("%.0f", ($res_x*25.4/$size_x)) : '';
+ $diagonal = ($res_x && $size_x) ? sprintf("%.1f", (sqrt($size_x**2 + $size_y**2)/25.4 )) : '';
+ $diagonal += 0 if $diagonal;# trick to get rid of decimal 0
+ $diagonal_m = ($res_x && $size_x) ? sprintf("%.0f", (sqrt($size_x**2 + $size_y**2))) : '';
+ }
+ $screen = {
+ 'screen' => $screen_id,
+ 'res-x' => $res_x,
+ 'res-x-i' => $res_x_i,
+ 'res-y' => $res_y,
+ 'res-y-i' => $res_y_i,
+ 'size-x' => $size_x,
+ 'size-x-i' => $size_x_i,
+ 'size-y' => $size_y,
+ 'size-y-i' => $size_y_i,
+ 's-dpi' => $dpi,
+ 'diagonal' => $diagonal,
+ 'diagonal-m' => $diagonal_m,
+ };
+ push @{$graphics{'screens'}}, $screen;
+ }
+ }
+ #print Data::Dumper::Dumper $graphics{'screens'};
+ if (my $program = main::check_program('xrandr')){
+ ($diagonal,$diagonal_m,$dpi) = (undef);
+ ($screen_id,$screen,@working) = (undef);
+ ($res_x,$res_x_i,$res_y,$res_y_i,$size_x,$size_x_i,$size_y,$size_y_i) = (undef);
+ my ($monitor,@monitors,$monitor_id,$screen,$screen_id,@xrandr_screens);
+ my @xrandr = main::grabber("$program $display_opt 2>/dev/null",'','strip');
+ #$graphics{'dimensions'} = (\@dimensions);
+ # we get a bit more info from xrandr than xdpyinfo, but xrandr fails to handle
+ # multiple screens from different video cards
+ foreach (@xrandr){
+ if (/^Screen ([0-9]+):/){
+ $screen_id = $1;
+ push @xrandr_screens, \@monitors if @monitors;
+ @monitors = ();
+ }
+ if (/^([^\s]+)\s+connected\s(primary\s)?([0-9]+)\s*x\s*([0-9]+)\+[0-9+]+(\s\([^)]+\))?(\s([0-9]+)mm\sx\s([0-9]+)mm)?/){
+ $monitor_id = $1;
+ $res_x = $3;
+ $res_y = $4;
+ $size_x = $7;
+ $size_y = $8;
+ $res_x_i = ($3) ? sprintf("%.1f", ($3/25.4)) : 0;
+ $res_y_i = ($4) ? sprintf("%.1f", ($4/25.4)) : 0;
+ $size_x_i = ($7) ? sprintf("%.1f", ($7/25.4)) : 0;
+ $size_y_i = ($8) ? sprintf("%.1f", ($8/25.4)) : 0;
+ $dpi = ($res_x && $size_x) ? sprintf("%.0f", $res_x * 25.4 / $size_x) : '';
+ $diagonal = ($res_x && $size_x) ? sprintf("%.1f", (sqrt($size_x**2 + $size_y**2)/25.4 )) : '';
+ $diagonal += 0 if $diagonal; # trick to get rid of decimal 0
+ $diagonal_m = ($res_x && $size_x) ? sprintf("%.0f", (sqrt($size_x**2 + $size_y**2))) : '';
+ $monitor = {
+ 'screen' => $screen_id,
+ 'monitor' => $monitor_id,
+ 'res-x' => $res_x,
+ 'res-x-i' => $res_x_i,
+ 'res-y' => $res_y,
+ 'res-y-i' => $res_y_i,
+ 'size-x' => $size_x,
+ 'size-x-i' => $size_x_i,
+ 'size-y' => $size_y,
+ 'size-y-i' => $size_y_i,
+ 'dpi' => $dpi,
+ 'diagonal' => $diagonal,
+ 'diagonal-m' => $diagonal_m,
+ };
+ push @monitors, $monitor;
+ # print "x:$size_x y:$size_y rx:$res_x ry:$res_y dpi:$dpi\n";
+ ($res_x,$res_x_i,$res_y,$res_y_i,$size_x,$size_x_i,$size_y,$size_y_i) = (0,0,0,0,0,0,0,0);
+
+ }
+ my @working = split /\s+/,$_;
+ # print join "$_\n";
+ if ($working[1] =~ /\*/){
+ $working[1] =~ s/\*|\+//g;
+ $working[1] = sprintf("%.0f",$working[1]);
+ $monitors[scalar @monitors - 1]{'hz'} = $working[1] if @monitors;
+ ($diagonal,$dpi) = ('','');
+ # print Data::Dumper::Dumper \@monitors;
+ }
+ }
+ push @xrandr_screens, \@monitors if @monitors;
+ #print "xrand: " . Data::Dumper::Dumper \@xrandr_screens;
+ my ($i) = (0);
+ foreach (@{$graphics{'screens'}}){
+ my %main = %$_;
+ # print "h: " . Data::Dumper::Dumper \%main;
+ #print $main{'screen'}, "\n";
+ foreach my $ref2 (@xrandr_screens){
+ my @screens = @$ref2;
+ # print "d: " . Data::Dumper::Dumper \@screens;
+ if ($screens[0]{'screen'} eq $main{'screen'}){
+ ${$graphics{'screens'}}[$i]{'monitors'} = \@screens;
+ last;
+ }
+ }
+ $i++;
+ }
+ if (!$graphics{'screens'}) {
+ $graphics{'tty'} = tty_data();
+ }
+ }
+ }
+ else {
+ $graphics{'no-xdpyinfo'} = main::row_defaults('xdpyinfo-missing');
+ }
+ print 'last: ', Data::Dumper::Dumper $graphics{'screens'} if $test[17];
+ main::log_data('dump','$graphics{screens}',$graphics{'screens'}) if $b_log;
+ eval $end if $b_log;
+}
+sub wayland_display_data {
+ eval $start if $b_log;
+
+ #print 'last: ', Data::Dumper::Dumper $graphics{'screens'};
+ eval $end if $b_log;
+}
+sub set_compositor {
+ eval $start if $b_log;
+ my ($protocol) = @_;
+ # initial tests, if wayland, it is certainly a compositor
+ $protocol = lc($protocol) if $protocol;
+ $graphics{'compositor'} = display_compositor($protocol);
+ # gnome-shell is incredibly slow to return version
+ if (($extra > 2 || $protocol eq 'wayland') && $graphics{'compositor'} &&
+ ( !$show{'system'} || $graphics{'compositor'} ne 'gnome-shell' ) ){
+ $graphics{'compositor-version'} = (main::program_data($graphics{'compositor'},$graphics{'compositor'},3))[1];
+ }
+ eval $end if $b_log;
+}
+sub get_protocol {
+ eval $start if $b_log;
+ my ($protocol) = ('');
+ $protocol = $ENV{'XDG_SESSION_TYPE'} if $ENV{'XDG_SESSION_TYPE'};
+ $protocol = $ENV{'WAYLAND_DISPLAY'} if (!$protocol && $ENV{'WAYLAND_DISPLAY'});
+ # yes, I've seen this in 2019 distros, sigh
+ $protocol = '' if $protocol eq 'tty';
+ # need to confirm that there's a point to this test, I believe no, fails out of x
+ # loginctl also results in the session id
+ if (!$protocol && $b_display && $b_force_display){
+ if (my $program = main::check_program('loginctl')){
+ my $id = '';
+ # $id = $ENV{'XDG_SESSION_ID'}; # returns tty session in console
+ my @data = main::grabber("$program --no-pager --no-legend 2>/dev/null",'','strip');
+ foreach (@data){
+ next if /tty[v]?[0-6]$/; # freebsd: ttyv3
+ $id = (split /\s+/, $_)[0];
+ last; # multiuser? too bad, we'll go for the first one
+ }
+ if ($id ){
+ my $temp = (main::grabber("$program show-session $id -p Type --no-pager --no-legend 2>/dev/null"))[0];
+ $temp =~ s/Type=// if $temp;
+ # ssh will not show /dev/ttyx so would have passed the first test
+ $protocol = $temp if $temp && $temp ne 'tty';
+ }
+ }
+ }
+ eval $end if $b_log;
+ return $protocol;
+}
sub gl_data(){
eval $start if $b_log;
my $num = 0;
@@ -10362,7 +10776,6 @@ sub x_drivers {
$alternate .= $sep . $_;
}
}
- $loaded ||= 'none';
@driver_data = ($loaded,$unloaded,$failed,$alternate);
}
eval $end if $b_log;
@@ -11579,11 +11992,12 @@ sub if_ip {
# dig +short +time=1 +tries=1 myip.opendns.com. A @208.67.222.222
sub wan_ip {
eval $start if $b_log;
- my (@data,$ip,$ua);
+ my (@data,$b_dig,$ip,$ua);
my $num = 0;
# time: 0.06 - 0.07 seconds
if (!$b_skip_dig && (my $program = main::check_program('dig') )){
$ip = (main::grabber("$program +short +time=1 +tries=1 myip.opendns.com \@resolver1.opendns.com 2>/dev/null"))[0];
+ $b_dig = 1;
}
else {
# note: tests: akamai: 0.055 - 0.065 icanhazip.com: 0.177 0.164
@@ -11606,7 +12020,9 @@ sub wan_ip {
if ($ip && $use{'filter'}){
$ip = $filter_string;
}
- $ip ||= main::row_defaults('IP', 'WAN IP');
+ if (!$ip){
+ $ip = ($b_dig) ? main::row_defaults('IP-dig', 'WAN IP') : main::row_defaults('IP', 'WAN IP');
+ }
@data = ({
main::key($num++,'WAN IP') => $ip,
},);
@@ -12049,6 +12465,8 @@ sub create_output {
my %row = %$ref;
$num = 1;
next if $row{'type'} eq 'secondary' && $show{'partition'};
+ next if $show{'swap'} && $row{'fs'} && $row{'fs'} eq 'swap';
+ next if $row{'swap-type'} && $row{'swap-type'} ne 'partition';
if (!$row{'hidden'}){
@data2 = main::get_size($row{'size'}) if (defined $row{'size'});
$size = (@data2) ? $data2[0] . ' ' . $data2[1]: 'N/A';
@@ -12065,6 +12483,7 @@ sub create_output {
$dev_type = ($row{'dev-type'}) ? $row{'dev-type'} : 'dev';
$row{'dev-base'} = '/dev/' . $row{'dev-base'} if $dev_type eq 'dev' && $row{'dev-base'};
$dev = ($row{'dev-base'}) ? $row{'dev-base'} : 'N/A';
+ $row{'id'} =~ s|/home/[^/]+/(.*)|/home/$filter_string/$1| if $use{'filter'};
$j = scalar @rows;
@data = ({
main::key($num++,'ID') => $row{'id'},
@@ -12087,12 +12506,15 @@ sub create_output {
$rows[$j]{main::key($num++,'size')} = $size;
$rows[$j]{main::key($num++,'used')} = $used . $percent;
$rows[$j]{main::key($num++,'fs')} = $fs;
- if ($b_admin && $fs eq 'swap' && $row{'swappiness'}){
+ if ($b_admin && $fs eq 'swap' && defined $row{'swappiness'}){
$rows[$j]{main::key($num++,'swappiness')} = $row{'swappiness'};
}
- if ($b_admin && $fs eq 'swap' && $row{'cache-pressure'}){
+ if ($b_admin && $fs eq 'swap' && defined $row{'cache-pressure'}){
$rows[$j]{main::key($num++,'cache pressure')} = $row{'cache-pressure'};
}
+ if ($extra > 1 && $fs eq 'swap' && defined $row{'priority'}){
+ $rows[$j]{main::key($num++,'priority')} = $row{'priority'};
+ }
if ($b_admin && $row{'block-size'}){
$rows[$j]{main::key($num++,'block size')} = $row{'block-size'} . ' B';;
#$rows[$j]{main::key($num++,'physical')} = $row{'block-size'} . ' B';
@@ -12100,9 +12522,11 @@ sub create_output {
}
$rows[$j]{main::key($num++,$dev_type)} = $dev;
if ($show{'label'}){
+ $row{'label'} = main::apply_partition_filter('part', $row{'label'}, '') if $use{'filter-label'};
$rows[$j]{main::key($num++,'label')} = ($row{'label'}) ? $row{'label'}: 'N/A';
}
if ($show{'uuid'}){
+ $row{'uuid'} = main::apply_partition_filter('part', $row{'uuid'}, '') if $use{'filter-uuid'};
$rows[$j]{main::key($num++,'uuid')} = ($row{'uuid'}) ? $row{'uuid'}: 'N/A';
}
}
@@ -12270,7 +12694,6 @@ sub partition_data {
}
}
$id = join ' ', @row[$cols .. $#row];
- $id =~ s/\/home\/[^\/]+\/(.*)/\/home\/$filter_string\/$1/ if $use{'filter'};
$size = $row[$cols - $back_size];
if ($b_admin && -e "/sys/block/"){
@working = admin_data($blockdev,$dev_base,$size);
@@ -12319,18 +12742,24 @@ sub partition_data {
}
@data = swap_data();
@partitions = (@partitions,@data);
+ # print Data::Dumper::Dumper \@partitions if $test[16];
if (!$bsd_type && @lsblk){
@data = check_partition_data();
@partitions = (@partitions,@data) if @data;
}
main::log_data('dump','@partitions',\@partitions) if $b_log;
- # print Data::Dumper::Dumper \@partitions;
+ print Data::Dumper::Dumper \@partitions if $test[16];
eval $end if $b_log;
}
sub swap_data {
eval $start if $b_log;
- my (@swap,@working,$cache_pressure,$path,$label,$swappiness,$uuid);
+ return @swaps if $b_swaps;
+ $b_swaps = 1;
+ my (@data,@working);
+ my ($cache_pressure,$dev_base,$dev_type,$label,$mount,$path,
+ $pattern1,$pattern2,$percent_used,$priority,$size,$swap_type,
+ $swappiness,$used,$uuid);
my ($s,$j,$size_id,$used_id) = (1,0,2,3);
if (!$bsd_type){
# faster, avoid subshell, same as swapon -s
@@ -12343,10 +12772,12 @@ sub swap_data {
@working = main::grabber("$path -s 2>/dev/null");
}
if ($b_admin){
- my @data = swap_advanced_data();
+ @data = swap_advanced_data();
$swappiness = $data[0];
$cache_pressure = $data[1];
}
+ $pattern1 = 'partition|file|ram';
+ $pattern2 = '[^\s].*[^\s]';
}
else {
if ( $path = main::check_program('swapctl') ){
@@ -12354,32 +12785,57 @@ sub swap_data {
@working = main::grabber("$path -l -k 2>/dev/null");
}
($size_id,$used_id) = (1,2);
+ $pattern1 = '[0-9]+';
+ $pattern2 = '[^\s]+';
}
# now add the swap partition data, don't want to show swap files, just partitions,
# 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/ || /^\/dev\/(ramzwap|zram)/;
- my @data = split /\s+/, $_;
- my $dev_base = $data[0];
- $dev_base =~ s/^\/dev\///;
- my $dev_type = 'dev';
- my $size = $data[$size_id];
- my $used = $data[$used_id];
- my $percent_used = sprintf( "%.1f", ( $used/$size )*100 );
- if ($show{'label'} && @labels){
- $label = get_label($data[0]);
- }
- if ($show{'uuid'} && @uuids){
- $uuid = get_uuid($data[0]);
- }
- if ($bsd_type && @gpart && ($show{'label'} || $show{'uuid'} ) ){
- my @extra = get_bsd_label_uuid("$dev_base");
- if (@extra){
- $label = $extra[0];
- $uuid = $extra[1];
- }
- }
+ #next if ! /^\/dev/ || /^\/dev\/(ramzwap|zram)/;
+ next if /^(Device|Filename)/;
+ ($dev_base,$dev_type,$label,$mount,$priority,
+ $swap_type,$uuid) = ('','','','',undef,'partition','');
+ @data = split /\s+/, $_;
+ if (/^\/dev\/(compcache|ramzwap|zram)/i){
+ $swap_type = 'zram';
+ $dev_type = 'dev';
+ }
+ elsif ($data[1] && $data[1] eq 'ram'){
+ $swap_type = 'ram';
+ }
+ elsif (m|^/dev|){
+ $swap_type = 'partition';
+ $dev_base = $data[0];
+ $dev_base =~ s|^/dev/||;
+ if ($show{'label'} && @labels){
+ $label = get_label($data[0]);
+ }
+ if ($show{'uuid'} && @uuids){
+ $uuid = get_uuid($data[0]);
+ }
+ if ($bsd_type && @gpart && ($show{'label'} || $show{'uuid'} ) ){
+ my @extra = get_bsd_label_uuid("$dev_base");
+ if (@extra){
+ $label = $extra[0];
+ $uuid = $extra[1];
+ }
+ }
+ $dev_type = 'dev';
+ }
+ elsif ($data[1] && $data[1] eq 'file' || m|^/|){
+ $swap_type = 'file';
+ }
+ $priority = $data[-1] if !$bsd_type;
+ # swpaon -s: /dev/sdb1 partition 16383996 109608 -2
+ # swapctl -l -k: /dev/label/swap0.eli 524284 154092
+ # users could have space in swapfile name
+ if (/^($pattern2)\s+($pattern1)\s+/){
+ $mount = main::trimmer($1);
+ }
+ $size = $data[$size_id];
+ $used = $data[$used_id];
+ $percent_used = sprintf( "%.1f", ( $used/$size )*100 );
@data = ({
'cache-pressure' => $cache_pressure,
'dev-base' => $dev_base,
@@ -12387,22 +12843,27 @@ sub swap_data {
'fs' => 'swap',
'id' => "swap-$s",
'label' => $label,
+ 'mount' => $mount,
+ 'priority' => $priority,
'size' => $size,
'swappiness' => $swappiness,
'type' => 'main',
+ 'swap-type' => $swap_type,
'used' => $used,
'uuid' => $uuid,
'percent-used' => $percent_used,
});
- @swap = (@swap,@data);
+ @swaps = (@swaps,@data);
$s++;
}
+ main::log_data('dump','@swaps',\@swaps) if $b_log;
+ print Data::Dumper::Dumper \@swaps if $test[15];;
eval $end if $b_log;
- return @swap;
+ return @swaps;
}
sub swap_advanced_data {
eval $start if $b_log;
- my ($swappiness,$cache_pressure) = ('','');
+ my ($swappiness,$cache_pressure) = (undef,undef);
if (-r "/proc/sys/vm/swappiness"){
$swappiness = (main::reader("/proc/sys/vm/swappiness"))[0];
if (defined $swappiness){
@@ -15872,6 +16333,106 @@ sub slot_data {
}
}
+## SwapData
+{
+package SwapData;
+
+sub get {
+ eval $start if $b_log;
+ my (@data,@rows,$key1,$val1);
+ my $num = 0;
+ @rows =create_output();
+ if (!@rows){
+ @data = (
+ {main::key($num++,'Alert') => main::row_defaults('swap-data')},
+ );
+ @rows = (@data);
+ }
+ eval $end if $b_log;
+ return @rows;
+}
+sub create_output {
+ eval $start if $b_log;
+ my $num = 0;
+ my $j = 0;
+ my (@data,@data2,%part,@rows,$dev,$percent,$raw_size,$size,$used);
+ my @swap_data = PartitionData::swap_data();
+ foreach my $ref (@swap_data){
+ my %row = %$ref;
+ $num = 1;
+ @data2 = main::get_size($row{'size'}) if (defined $row{'size'});
+ $size = (@data2) ? $data2[0] . ' ' . $data2[1]: 'N/A';
+ @data2 = main::get_size($row{'used'}) if (defined $row{'used'});
+ $used = (@data2) ? $data2[0] . ' ' . $data2[1]: 'N/A';
+ $percent = (defined $row{'percent-used'}) ? ' (' . $row{'percent-used'} . '%)' : '';
+ %part = ();
+ $dev = ($row{'swap-type'} eq 'file') ? 'file' : 'dev';
+ $row{'swap-type'} = ($row{'swap-type'}) ? $row{'swap-type'} : 'N/A';
+ if ($b_admin && !$bsd_type && $j == 0){
+ $j = scalar @rows;
+ if (defined $row{'swappiness'} || defined $row{'cache-pressure'}){
+ $rows[$j]{main::key($num++,'Kernel')} = '';
+ if (defined $row{'swappiness'}){
+ $rows[$j]{main::key($num++,'swappiness')} = $row{'swappiness'};
+ }
+ if (defined $row{'cache-pressure'}){
+ $rows[$j]{main::key($num++,'cache pressure')} = $row{'cache-pressure'};
+ }
+ }
+ else {
+ $rows[$j]{main::key($num++,'Message')} = main::row_defaults('swap-admin');
+ }
+ }
+ $j = scalar @rows;
+ @data = ({
+ main::key($num++,'ID') => $row{'id'},
+ main::key($num++,'type') => $row{'swap-type'},
+ });
+ @rows = (@rows,@data);
+ # not used for swap as far as I know
+ if ($b_admin && $row{'raw-size'} ){
+ # It's an error! permissions or missing tool
+ if (!main::is_numeric($row{'raw-size'})){
+ $raw_size = $row{'raw-size'};
+ }
+ else {
+ @data2 = main::get_size($row{'raw-size'});
+ $raw_size = (@data2) ? $data2[0] . ' ' . $data2[1]: 'N/A';
+ }
+ $rows[$j]{main::key($num++,'raw size')} = $raw_size;
+ }
+ # not used for swap as far as I know
+ if ($b_admin && $row{'raw-available'} && $size ne 'N/A'){
+ $size .= ' (' . $row{'raw-available'} . '%)';
+ }
+ $rows[$j]{main::key($num++,'size')} = $size;
+ $rows[$j]{main::key($num++,'used')} = $used . $percent;
+ # not used for swap as far as I know
+ if ($b_admin && $row{'block-size'}){
+ $rows[$j]{main::key($num++,'block size')} = $row{'block-size'} . ' B';;
+ #$rows[$j]{main::key($num++,'physical')} = $row{'block-size'} . ' B';
+ #$rows[$j]{main::key($num++,'logical')} = $row{'block-logical'} . ' B';
+ }
+ if ($extra > 1 && defined $row{'priority'}){
+ $rows[$j]{main::key($num++,'priority')} = $row{'priority'};
+ }
+ $row{'mount'} =~ s|/home/[^/]+/(.*)|/home/$filter_string/$1| if $row{'mount'} && $use{'filter'};
+ $rows[$j]{main::key($num++,$dev)} = ($row{'mount'}) ? $row{'mount'} : 'N/A';
+ if ($show{'label'} && ($row{'label'} || $row{'swap-type'} eq 'partition') ){
+ $row{'label'} = main::apply_partition_filter('part', $row{'label'}, '') if $use{'filter-label'};
+ $rows[$j]{main::key($num++,'label')} = ($row{'label'}) ? $row{'label'}: 'N/A';
+ }
+ if ($show{'uuid'} && ($row{'uuid'} || $row{'swap-type'} eq 'partition' )){
+ $row{'uuid'} = main::apply_partition_filter('part', $row{'uuid'}, '') if $use{'filter-uuid'};
+ $rows[$j]{main::key($num++,'uuid')} = ($row{'uuid'}) ? $row{'uuid'}: 'N/A';
+ }
+ }
+ eval $end if $b_log;
+ return @rows;
+}
+
+}
+
## UnmountedData
{
package UnmountedData;
@@ -15928,12 +16489,14 @@ sub create_output {
$fs = 'requires file';
}
}
+ $row{'label'} = main::apply_partition_filter('part', $row{'label'}, '') if $use{'filter-label'};
+ $row{'uuid'} = main::apply_partition_filter('part', $row{'uuid'}, '') if $use{'filter-uuid'};
@data = ({
- main::key($num++,'ID') => , "/dev/$row{'dev-base'}",
- main::key($num++,'size') => , $size,
- main::key($num++,'fs') => , $fs,
- main::key($num++,'label') => , $row{'label'},
- main::key($num++,'uuid') => , $row{'uuid'},
+ main::key($num++,'ID') => "/dev/$row{'dev-base'}",
+ main::key($num++,'size') => $size,
+ main::key($num++,'fs') => $fs,
+ main::key($num++,'label') => $row{'label'},
+ main::key($num++,'uuid') => $row{'uuid'},
});
@rows = (@rows,@data);
}
@@ -17393,7 +17956,7 @@ sub set_info_data {
my (@data,@info,$item);
my $pattern = 'alltray|awn|bar|bmpanel|bmpanel2|budgie-panel|cairo-dock|';
$pattern .= 'dde-dock|dmenu|dockbarx|docker|docky|dzen|dzen2|';
- $pattern .= 'fancybar|fbpanel|fspanel|glx-dock|gnome-panel|hpanel|i3bar|icewmtray|';
+ $pattern .= 'fancybar|fbpanel|fspanel|glx-dock|gnome-panel|hpanel|i3bar|i3status|icewmtray|';
$pattern .= 'kdocker|kicker|';
$pattern .= 'latte|latte-dock|lemonbar|ltpanel|lxpanel|lxqt-panel|';
$pattern .= 'matchbox-panel|mate-panel|ourico|';
@@ -17990,6 +18553,7 @@ sub ubuntu_id {
$codename = lc($codename);
my ($id) = ('');
my %codenames = (
+ 'focal' => '20.04 LTS',
'eoan' => '19.10',
'disco' => '19.04',
'cosmic' => '18.10',
@@ -18578,6 +19142,7 @@ sub get_shell_data {
$client{'version'} = row_defaults('unknown-shell');
}
}
+ $client{'version'} ||= '';
$client{'version'} =~ s/(\(.*|-release|-version)//;
}
$client{'name'} = lc($shell);
@@ -19193,8 +19758,9 @@ sub check_audio {
else {return 0}
}
sub check_graphics {
- if ( ( $_[1] && length($_[1]) == 4 && $_[1] =~/^03/ ) ||
- ( $_[0] && $_[0] =~ /^(vga|display|hdmi|3d)$/)){
+ # note: multimedia class 04 is viddeo if 0400. 'tv' is risky I think
+ if ( ( $_[1] && length($_[1]) == 4 && ($_[1] =~/^03/ || $_[1] eq '0400' ) ) ||
+ ( $_[0] && $_[0] =~ /^(vga|display|hdmi|3d|video|tv|television)$/)){
return 1;
}
else {return 0}
@@ -20258,11 +20824,13 @@ sub generate_lines {
assign_data(%row);
}
if ( $show{'graphic'} ){
+ USBData::set() if !$b_usb_check;
DeviceData::set($b_pci_check) if !$b_pci_check;
%row = line_handler('Graphics','graphic');
assign_data(%row);
}
if ( $show{'audio'} ){
+ # Note: USBData is set internally in AudioData because it's only run in one case
DeviceData::set($b_pci_check) if !$b_pci_check;
%row = line_handler('Audio','audio');
assign_data(%row);
@@ -20288,6 +20856,10 @@ sub generate_lines {
%row = line_handler('Partition','partition');
assign_data(%row);
}
+ if ( $show{'swap'} ){
+ %row = line_handler('Swap','swap');
+ assign_data(%row);
+ }
if ( $show{'unmounted'} ){
%row = line_handler('Unmounted','unmounted');
assign_data(%row);
@@ -20342,6 +20914,7 @@ sub line_handler {
'process' => \&ProcessData::get,
'sensor' => \&SensorData::get,
'slot' => \&SlotData::get,
+ 'swap' => \&SwapData::get,
'unmounted' => \&UnmountedData::get,
'usb' => \&UsbData::get,
'weather' => \&WeatherData::get,
@@ -20613,6 +21186,9 @@ sub generate_system_data {
}
if ($b_admin && (my $params = get_kernel_parameters())){
$index = scalar(@{ $data{$data_name} } );
+ #print "$params\n";
+ $params = apply_partition_filter('system', $params, 'label') if $use{'filter-label'};
+ $params = apply_partition_filter('system', $params, 'uuid') if $use{'filter-uuid'};
$data{$data_name}[$index]{main::key($num++,'parameters')} = $params;
$index = scalar(@{ $data{$data_name} } );
}
diff --git a/inxi.1 b/inxi.1
index 09dd819..6c48ca3 100644
--- a/inxi.1
+++ b/inxi.1
@@ -1,21 +1,24 @@
-.TH INXI 1 "2020\-03\-14" inxi "inxi manual"
+.TH INXI 1 "2020\-04\-22" inxi "inxi manual"
+
.SH NAME
inxi \- Command line system information script for console and IRC
+
.SH SYNOPSIS
\fBinxi\fR
-\fBinxi\fR [\fB\-AbBCdDfFGhiIlmMnNopPrRsSuUVwzZ\fR]
+\fBinxi\fR [\fB\-AbBCdDfFGhijJIlmMnNopPrRsSuUVwzZ\fR]
\fBinxi\fR [\fB\-c NUMBER\fR] [\fB\-t\fR
[\fBc\fR|\fBm\fR|\fBcm\fR|\fBmc\fR][\fBNUMBER\fR]]
[\fB\-v NUMBER\fR] [\fB\-W LOCATION\fR]
[\fB\-\-weather\-unit\fR {\fBm\fR|\fBi\fR|\fBmi\fR|\fBim\fR}] [\fB\-y WIDTH\fR]
+
\fBinxi\fR [\fB\-\-memory\-modules\fR] [\fB\-\-memory\-short\fR]
-[\fB\-\-recommends\fR] [\fB\-\-slots\fR] [\fB\-\-usb\fR]
+[\fB\-\-recommends\fR] [\fB\-\-slots\fR]
-\fBinxi\fB [\fB\-x\fR|\fB\-xx\fR|\fB\-xxx\fR|\fB\-a\fR|\fB\-\-admin\fR] \fB\-OPTION(s)\fR
+\fBinxi\fB [\fB\-x\fR|\fB\-xx\fR|\fB\-xxx\fR|\fB\-a\fR] \fB\-OPTION(s)\fR
-All options have long form variants \- see below for these and more advanced options.
+All short form options have long form variants \- see below for these and more advanced options.
.SH DESCRIPTION
\fBinxi\fR is a command line system information script built for console
@@ -44,23 +47,28 @@ Options can be combined if they do not conflict. You can either group the letter
together or separate them.
Letters with numbers can have no gap or a gap at your discretion, except when
-using \fB \-t\fR.
+using \fB \-t\fR. Note that if you use an option that requires an additional
+argument, that must be last in the short form group of options. Otherwise
+you can use those separately as well.
For example:
-.B inxi
-\fB\-AG\fR or \fBinxi \-A \-G\fR or \fBinxi \-c10\fR
+\fBinxi \-AG\fR | \fBinxi \-A \-G\fR | \fBinxi \-b\fR | \fBinxi \-c10\fR
+| \fBinxi \-FxxzJy80\fR
Note that all the short form options have long form equivalents, which are
listed below. However, usually the short form is used in examples in order to
keep things simple.
.SH STANDARD OPTIONS
+
.TP
.B \-A\fR,\fB \-\-audio\fR
Show Audio/sound card(s) information, including card driver.
+
.TP
.B \-b\fR,\fB \-\-basic\fR
Show basic output, short form. Same as: \fBinxi \-v 2\fR
+
.TP
.B \-B\fR,\fB \-\-battery\fR
Show system battery (\fBID\-x\fR) data, charge, condition, plus extra information
@@ -99,27 +107,34 @@ piped or redirected. You must use the explicit runtime \fB\-c <color number>\fR
if you want color codes to be present in the piped/redirected output.
Color selectors for each type display (NOTE: IRC and global only show safe color set):
+
.TP
.B \-c 94\fR
\- Console, out of X.
+
.TP
.B \-c 95\fR
\- Terminal, running in X \- like xTerm.
+
.TP
.B \-c 96\fR
\- GUI IRC, running in X \- like XChat, Quassel,
Konversation etc.
+
.TP
.B \-c 97\fR
\- Console IRC running in X \- like irssi in xTerm.
+
.TP
.B \-c 98\fR
\- Console IRC not in X.
+
.TP
.B \-c 99\fR
\- Global \- Overrides/removes all settings.
Setting a specific color type removes the global color selection.
+
.TP
.B \-C\fR,\fB \-\-cpu\fR
Show full CPU output, including per CPU clock speed and CPU max speed (if available).
@@ -146,9 +161,10 @@ The details for each CPU include a technical description e.g. \fBtype: MT MCP\fR
.B \-d\fR,\fB \-\-disk\-full\fR,\fB\-\-optical\fR
Show optical drive data as well as \fB\-D\fR hard drive data. With \fB\-x\fR, adds a
feature line to the output. Also shows floppy disks if present. Note that there is
-no current way to get any information about the floppy device that I am aware of,
+no current way to get any information about the floppy device that we are aware of,
so it will simply show the floppy ID without any extra data. \fB\-xx\fR adds a
few more features.
+
.TP
.B \-D\fR,\fB \-\-disk\fR
Show Hard Disk info. Shows total disk space and used percentage. The disk used
@@ -162,20 +178,39 @@ has no access to the used amount.
Also shows per disk information: Disk ID, type (if present), vendor (if detected),
model, and size. See \fBExtra Data Options\fR (\fB\-x\fR options) and
\fBAdmin Extra Data Options\fR (\fB\-\-admin\fR options) for many more features.
+
+.TP
+.B \-\-filter\fR,\fB \-\-filter\-override\fR \- See \fB\-z\fR, \fB\-Z\fR.
+
+.TP
+.B \-\-filter\-label\fR
+Filter partition label names from \fB\-j\fR, \fB\-o\fR, \fB\-p\fR,
+\fB\-P\fR, and \fB\-Sa\fR (root=LABEL=...). Generally only useful in
+very specialized cases.
+
+.TP
+.B \-\-filter\-uuid\fR
+Filter partition UUIDs from \fB\-j\fR, \fB\-o\fR, \fB\-p\fR,
+\fB\-P\fR, and \fB\-Sa\fR (root=UUID=...). Generally only useful in
+very specialized cases.
+
.TP
.B \-f\fR,\fB \-\-flags\fR
Show all CPU flags used, not just the short list. Not shown with \fB\-F\fR in order
to avoid spamming. ARM CPUs: show \fBfeatures\fR items.
+
.TP
.B \-F\fR,\fB \-\-full\fR
Show Full output for inxi. Includes all Upper Case line letters except \fB\-W\fR,
-plus \fB\-s\fR and \fB\-n\fR. Does not show extra verbose options such as
+plus \fB\-\-swap\fR, \fB\-s\fR and \fB\-n\fR. Does not show extra verbose options such as
\fB\-d \-f \-i \-l \-m \-o \-p \-r \-t \-u \-x\fR unless you use those arguments in
the command, e.g.: \fBinxi \-Frmxx\fR
+
.TP
.B \-G\fR,\fB \-\-graphics\fR
Show Graphic card(s) information, including details of card and card driver,
-display protocol (if available), display server (vendor and version number), e.g.:
+display protocol (if available), display server (and/or Wayland compositor),
+vendor and version number, e.g.:
\fBDisplay: x11 server: Xorg 1.15.1\fR
@@ -183,15 +218,18 @@ If protocol is not detected, shows:
\fBDisplay: server: Xorg 1.15.1\fR
-Also shows screen resolution(s), OpenGL renderer, OpenGL core profile version/OpenGL
-version.
+Also shows screen resolution(s) (per monitor/X screen), OpenGL renderer,
+OpenGL core profile version/OpenGL version.
+
+Compositor information will show if detected using \fB\-xx\fR option
+or always if detected and Wayland.
-Compositor information will show if detected using \fB\-xx\fR option.
.TP
.B \-h\fR,\fB \-\-help\fR
The help menu. Features dynamic sizing to fit into terminal window. Set script
global \fBCOLS_MAX_CONSOLE\fR if you want a different default value, or
use \fB\-y <width>\fR to temporarily override the defaults or actual window width.
+
.TP
.B \-i\fR,\fB \-\-ip\fR
Show WAN IP address and local interfaces (latter requires \fBifconfig\fR or
@@ -211,10 +249,37 @@ Memory: report of \fB\-m\fR, not in \fB\Info:\fR.
Rasberry Pi only: uses \fBvcgencmd get_mem gpu\fR to get gpu RAM amount,
if user is in video group and \fBvcgencmd\fR is installed. Uses
this result to increase the \fBMemory:\fR amount and \fBused:\fR amounts.
+
+.TP
+.B \-j\fR, \fB\-\-swap\fR
+Shows all active swap types (partition, file, zram). When this option is used,
+swap partition(s) will not show on the \fB\-P\fR line to avoid redundancy.
+
+.TP
+.B \-J\fR,\fB \-\-usb\fR
+Show USB data for attached Hubs and Devices. Hubs also show number of ports.
+Be aware that a port is not always external, some may be internal, and either
+used or unused (for example, a motherboard USB header connector that is not used).
+
+Hubs and Devices are listed in order of BusID.
+
+BusID is generally in this format: BusID\-port[.port][.port]:DeviceID
+
+Device ID is a number created by the kernel, and has no necessary ordering
+or sequence connection, but can be used to match this output to lsusb
+values, which generally shows BusID / DeviceID (except for tree view, which
+shows ports).
+
+Examples: \fBDevice\-3: 4\-3.2.1:2\fR or \fBHub: 4\-0:1\fR
+
+The \fBrev: 2.0\fR item refers to the USB revision number, like \fB1.0\fR or
+\fB3.1\fR.
+
.TP
.B \-l\fR,\fB \-\-label\fR
Show partition labels. Default: main partitions \fB\-P\fR. For full \fB\-p\fR output,
use: \fB\-pl\fR.
+
.TP
.B \-m\fR,\fB \-\-memory\fR
Memory (RAM) data. Does not display with \fB\-b\fR or \fB\-F\fR unless you use \fB\-m\fR
@@ -242,15 +307,18 @@ not dmi data. For most people, the data will be right, but a significant percent
users will have either a wrong max module size, if present, or max capacity.
See \fB\-\-memory\-modules\fR and \fB\-\-memory\-short\fR if you want a shorter report.
+
.TP
.B \-\-memory\-modules\fR
Memory (RAM) data. Show only RAM arrays and modules in Memory report.
Skip empty slots. See \fB\-m\fR.
+
.TP
.B \-\-memory\-short\fR
-Memory (RAM) data. Show a one line RAM report in Memory, e.g.
-\fBReport: arrays: 1 slots: 4 modules: 2 type: DDR4\fR
-See \fB\-m\fR.
+Memory (RAM) data. Show a one line RAM report in Memory. See \fB\-m\fR.
+
+Sample: \fBReport: arrays: 1 slots: 4 modules: 2 type: DDR4\fR
+
.TP
.B \-M\fR,\fB \-\-machine\fR
Show machine data. Device, Motherboard, BIOS, and if present, System Builder (Like Lenovo).
@@ -269,14 +337,17 @@ post an issue and we'll get it fixed if possible.
Due to unreliable vendor data, device type will show: desktop, laptop, notebook, server,
blade, plus some obscure stuff that inxi is unlikely to ever run on.
+
.TP
.B \-n\fR,\fB \-\-network\-advanced\fR
Show Advanced Network card information in addition to that produced by \fB\-N\fR.
Shows interface, speed, MAC ID, state, etc.
+
.TP
.B \-N\fR,\fB \-\-network\fR
Show Network card(s) information, including card driver. With \fB\-x\fR, shows PCI BusID,
Port number.
+
.TP
.B \-o\fR,\fB \-\-unmounted\fR
Show unmounted partition information (includes UUID and LABEL if available).
@@ -287,14 +358,22 @@ if you have added to \fB/etc/sudoers\fR (sudo v. 1.7 or newer):
.B <username> ALL = NOPASSWD: /usr/bin/file (sample)
Does not show components (partitions that create the md\-raid array) of md\-raid arrays.
+
.TP
.B \-p\fR,\fB \-\-partitions\-full\fR
Show full Partition information (\fB\-P\fR plus all other detected mounted partitions).
+
.TP
.B \-P\fR,\fB \-\-partitions\fR
Show basic Partition information.
Shows, if detected: \fB/ /boot /home /opt /tmp /usr /usr/home /var /var/tmp /var/log\fR.
+If \fB\-\-swap\fR is not used, shows active swap partitions (never shows file or
+zram type swap).
Use \fB\-p\fR to see all mounted partitions.
+
+.TP
+.B \-\-processes\fR \- See \fB\-t\fR
+
.TP
.B \-r\fR,\fB \-\-repos\fR
Show distro repository data. Currently supported repo types:
@@ -302,7 +381,7 @@ Show distro repository data. Currently supported repo types:
\fBAPK\fR (Alpine Linux + derived versions)
\fBAPT\fR (Debian, Ubuntu + derived versions, as well as RPM based
-APT distros like PCLinuxOS or Alt-Linux)
+APT distros like PCLinuxOS or Alt\-Linux)
\fBCARDS\fR (NuTyX + derived versions)
@@ -330,6 +409,7 @@ APT distros like PCLinuxOS or Alt-Linux)
More will be added as distro data is collected. If yours is missing please
show us how to get this information and we'll try to add it.
+
.TP
.B \-R\fR,\fB \-\-raid\fR
Show RAID data. Shows RAID devices, states, levels and components, and
@@ -349,6 +429,7 @@ if there is demand, and reasonable reporting tools.
.B \-\-recommends\fR
Checks inxi application dependencies and recommends, as well as directories,
then shows what package(s) you need to install to add support for each feature.
+
.TP
.B \-s\fR,\fB \-\-sensors\fR
Show output from sensors if sensors installed/configured: Motherboard/CPU/GPU
@@ -359,12 +440,17 @@ if present.
.TP
.B \-\-slots\fR
Show PCI slots with type, speed, and status information.
+
+.TP
+.B \-\-swap\fR \- See \fB\-j\fR
+
.TP
.B \-S\fR,\fB \-\-system\fR
Show System information: host name, kernel, desktop environment (if in X),
distro. With \fB\-xx\fR show dm \- or startx \- (only shows if present and
running if out of X), and if in X, with \fB\-xxx\fR show more desktop info,
e.g. taskbar or panel.
+
.TP
.B \-t\fR,\fB \-\-processes\fR
[\fBc\fR|\fBm\fR|\fBcm\fR|\fBmc NUMBER\fR] Show processes. If no arguments, defaults to \fBcm\fR.
@@ -372,43 +458,27 @@ If followed by a number, shows that number of processes for each type
(default: \fB5\fR; if in IRC, max: \fB5\fR)
Make sure that there is no space between letters and numbers (e.g. write as \fB\-t cm10\fR).
+
.TP
.B \-t c\fR
\- CPU only. With \fB\-x\fR, also shows memory for that process on same line.
+
.TP
.B \-t m\fR
\- memory only. With \fB\-x\fR, also shows CPU for that process on same line.
If the \-I line is not triggered, will also show the system RAM used/total
information.
+
.TP
.B \-t cm\fR
\- CPU+memory. With \fB\-x\fR, shows also CPU or memory for that process on
same line.
.TP
-.B \-\-usb\fR
-Show USB data for attached Hubs and Devices. Hubs also show number of ports.
-Be aware that a port is not always external, some may be internal, and either
-used or unused (for example, a motherboard USB header connector that is not used).
-
-Hubs and Devices are listed in order of BusID.
-
-BusID is generally in this format: BusID-port[.port][.port]:DeviceID
-
-Device ID is a number created by the kernel, and has no necessary ordering
-or sequence connection, but can be used to match this output to lsusb
-values, which generally shows BusID / DeviceID (except for tree view, which
-shows ports).
-
-Examples: \fBDevice-3: 4-3.2.1:2\fR or \fBHub: 4-0:1\fR
-
-The \fBrev: 2.0\fR item refers to the USB revision number, like \fB1.0\fR or
-\fB3.1\fR.
-
-.TP
.B \-u\fR,\fB \-\-uuid\fR
Show partition UUIDs. Default: main partitions \fB\-P\fR. For full \fB\-p\fR
output, use: \fB\-pu\fR.
+
.TP
.B \-U\fR,\fB \-\-update\fR
Note \- Maintainer may have disabled this function.
@@ -424,51 +494,65 @@ to that directory. See \fB\-\-man\fR or \fB\-\-no\-man\fR to force or disable
man install.
.TP
-.B \-V\fR,\fB \-\-version\fR
+.B \-\-usb\fR \- See \fB\-J\fR
+
+.TP
+.B \-V\fR, \fB\-\-version\fR
inxi version information. Prints information then exits.
+
.TP
.B \-v\fR,\fB \-\-verbosity\fR
Script verbosity levels. If no verbosity level number is given, 0 is assumed.
Should not be used with \fB\-b\fR or \fB\-F\fR.
Supported levels: \fB0\-8\fR Examples :\fB inxi \-v 4 \fR or \fB inxi \-v4\fR
+
.TP
.B \-v 0
\- Short output, same as: \fBinxi\fR
+
.TP
.B \-v 1
\- Basic verbose, \fB\-S\fR + basic CPU (cores, type, clock speed, and min/max
speeds, if available) + \fB\-G\fR + basic Disk + \fB\-I\fR.
+
.TP
.B \-v 2
\- Adds networking card (\fB\-N\fR), Machine (\fB\-M\fR) data, Battery (\fB\-B\fR)
(if available). Same as: \fBinxi \-b\fR
+
.TP
.B \-v 3
\- Adds advanced CPU (\fB\-C\fR) and network (\fB\-n\fR) data; triggers \fB\-x\fR
advanced data option.
+
.TP
.B \-v 4
\- Adds partition size/used data (\fB\-P\fR) for (if present):
\fB/ /home /var/ /boot\fR. Shows full disk data (\fB\-D\fR)
+
.TP
.B \-v 5
\- Adds audio card (\fB\-A\fR), memory/RAM (\fB\-m\fR), sensors (\fB\-s\fR),
-partition label (\fB\-l\fR), UUID (\fB\-u\fR), and short form of
-optical drives.
+partition label (\fB\-l\fR), UUID (\fB\-u\fR), full swap data (\fB\-j\fR),
+and short form of optical drives.
+
.TP
.B \-v 6
-\- Adds full mounted partition data (\fB\-p\fR), unmounted partition data (\fB\-o\fR),
-optical drive data (\fB\-d\fR), USB (\fB\-\-usb\fR); triggers \fB\-xx\fR extra data
-option.
+\- Adds full mounted partition data (\fB\-p\fR),
+unmounted partition data (\fB\-o\fR), optical drive data (\fB\-d\fR),
+USB (\fB\-J\fR); triggers \fB\-xx\fR extra data option.
+
.TP
.B \-v 7
\- Adds network IP data (\fB\-i\fR); triggers \fB\-xxx\fR
+
.TP
.B \-v 8
\- All system data available. Adds Repos (\fB\-r\fR), PCI slots (\fB\-\-slots\fR),
processes (\fB\-tcm\fR), admin (\fB\-\-admin\fR). Useful for testing output and to
see what data you can get from your system.
+
.TP
.B \-w\fR,\fB \-\-weather\fR
Adds weather line. To get weather for an alternate location, use
@@ -479,6 +563,7 @@ DO NOT USE THIS FEATURE FOR AUTOMATED WEATHER UPDATES! You will be blocked
from any further access. This feature is not meant for widget type
weather monitoring, or Conky type use. It is meant to get weather when you need to
see it, for example, on a remote server.
+
.TP
.B \-W\fR, \fB\-\-weather\-location <location_string>\fR
Get weather/time for an alternate location. Accepts postal/zip code[, country],
@@ -489,7 +574,7 @@ Try postal codes with and without country code added. Note that City,State appli
only to USA, otherwise it's City,Country. If country name (english) does not work,
try 2 character country code (e.g. Spain: es; Great Britain: gb).
-See \fIhttps://en.wikipedia.org/wiki/ISO_3166-1_alpha-2\fR for current 2 letter
+See \fIhttps://en.wikipedia.org/wiki/ISO_3166\-1_alpha\-2\fR for current 2 letter
country codes.
Use only ASCII letters in city/state/country names.
@@ -500,6 +585,7 @@ Examples: \fB\-W 95623,us\fR OR \fB\-W Boston,MA\fR OR
DO NOT USE THIS FEATURE FOR AUTOMATED WEATHER UPDATES! Use of automated queries,
will result in your access being blocked. If you try to work around the ban, you
will be permanently banned from this service.
+
.TP
.B \-\-weather\-source\fR, \fB\-\-ws <unit>\fR
[\fB1\-9\fR] Switches weather data source. Possible values are \fB1\-9\fR. \fB1\-4\fR
@@ -513,26 +599,31 @@ or be removed, so always test to verify which source is being used for each valu
if that is important to you. Data sources may be added or removed on occasions, so
try each one and see which you prefer. If you get unsupported source message, it means
that number has not been implemented.
+
.TP
.B \-\-weather\-unit <unit>\fR
[\fBm\fR|\fBi\fR|\fBmi\fR|\fBim\fR] Sets weather units to metric (\fBm\fR), imperial (\fBi\fR),
metric (imperial) (\fBmi\fR, default), imperial (metric) (\fBim\fR). If metric or imperial
not found,sets to default value, or \fBN/A\fR.
+
.TP
.B \-y\fR,\fB \-\-width <integer>\fR
This is an absolute width override which sets the output line width max.
Overrides \fBCOLS_MAX_IRC\fR / \fBCOLS_MAX_CONSOLE\fR globals, or the
actual widths of the terminal. \fB80\fR is the minimum width supported.
\fB\-1\fR removes width limits. Example: \fBinxi \-Fxx\ \-y 130\fR
+
.TP
.B \-z\fR,\fB \-\-filter\fR
Adds security filters for IP addresses, serial numbers, MAC,
location (\fB\-w\fR), and user home directory name. Removes Host:.
On by default for IRC clients.
+
.TP
.B \-Z\fR,\fB \-\-filter\-override\fR
Absolute override for output filters. Useful for debugging networking
issues in IRC for example.
+
.SH EXTRA DATA OPTIONS
These options can be triggered by one or more \fB\-x\fR.
Alternatively, the \fB\-v\fR options trigger them in the following
@@ -553,6 +644,7 @@ OR
The following details show which lines / items display extra information for each
extra data level.
+
.TP
.B \-x \-A\fR
\- Adds (if available and/or relevant) \fBvendor:\fR item, which shows
@@ -562,12 +654,14 @@ specific vendor [product] information.
device.
\- Adds PCI Bus ID/USB ID number of each Audio device.
+
.TP
.B \-x \-B\fR
\- Adds vendor/model, battery status (if battery present).
\- Adds attached battery powered peripherals (\fBDevice\-[number]:\fR) if
detected (keyboard, mouse, etc.).
+
.TP
.B \-x \-C\fR
\- Adds bogomips on CPU (if available)
@@ -579,16 +673,19 @@ etc.). Only shows data if detected. Newer microarchitectures will have
to be added as they appear, and require the CPU family ID and model ID.
Examples: \fBarch: Sandy Bridge rev: 2\fR, \fBarch: K8 rev.F+ rev: 2\fR
+
.TP
.B \-x \-d\fR
\- Adds more items to \fBFeatures\fR line of optical drive;
dds rev version to optical drive.
+
.TP
.B \-x \-D\fR
\- Adds HDD temperature with disk data if you have hddtemp installed, if you are root
or if you have added to \fB/etc/sudoers\fR (sudo v. 1.7 or newer):
.B <username> ALL = NOPASSWD: /usr/sbin/hddtemp (sample)
+
.TP
.B \-x \-G\fR
\- Adds (if available and/or relevant) \fBvendor:\fR item, which shows
@@ -599,12 +696,13 @@ specific vendor [product] information.
\- Adds (for single GPU, nvidia driver) screen number that GPU is running on.
\- Adds PCI Bus ID/USB ID number of each Graphics card.
+
.TP
.B \-x \-i\fR
\- Adds IP v6 additional scope data, like Global, Site, Temporary for
each interface.
-Note that there is no way I am aware of to filter out the deprecated
+Note that there is no way we are aware of to filter out the deprecated
IP v6 scope site/global temporary addresses from the output of
\fBifconfig\fR. The \fBip\fR tool shows that clearly.
@@ -635,6 +733,11 @@ versions.
\- Adds current runlevel (not available with all init systems).
\- If in shell (i.e. not in IRC client), adds shell version number, if available.
+
+.TP
+.B \-x \-J\fR (\fB\-\-usb\fR)
+\- For Devices, adds driver(s).
+
.TP
.B \-x \-m\fR, \fB\-\-memory\-modules\fR
\- If present, adds maximum memory module/device size in the Array line.
@@ -642,6 +745,7 @@ Only some systems will have this data available. Shows estimate if it can
generate one.
\- Adds device type in the Device line.
+
.TP
.B \-x \-N\fR
\- Adds (if available and/or relevant) \fBvendor:\fR item, which shows
@@ -650,15 +754,18 @@ specific vendor [product] information.
\- Adds version/port(s)/driver version (if available) for each Network card;
\- Adds PCI Bus ID/USB ID number of each Network card.
+
.TP
.B \-x \-R\fR
\- md\-raid: Adds second RAID Info line with extra data: blocks, chunk size,
bitmap (if present). Resync line, shows blocks synced/total blocks.
\- Hardware RAID: Adds driver version, bus ID.
+
.TP
.B \-x \-s\fR
\- Adds basic voltages: 12v, 5v, 3.3v, vbat (\fBipmi\fR, \fBlm-sensors\fR if present).
+
.TP
.B \-x \-S\fR
\- Adds Kernel gcc version.
@@ -668,29 +775,32 @@ a subset of distributions. The distro must be both derived from a parent distro
Ubuntu), and explicitly added to the supported distributions for this feature. Due to
the complexity of distribution identification, these will only be added as relatively solid
methods are found for each distribution system base detection.
+
.TP
-.B \-x \-t\fR
+.B \-x \-t\fR (\fB\-\-processes\fR)
\- Adds memory use output to CPU (\fB\-xt c\fR), and CPU use to memory
(\fB\-xt m\fR).
-.TP
-.B \-x \-\-usb\fR
-\- For Devices, adds driver(s).
+
.TP
.B \-x \-w\fR,\fB \-W\fR
\- Adds humidity and barometric pressure.
\- Adds wind speed and direction.
+
.TP
.B \-xx \-A\fR
\- Adds vendor:product ID for each Audio device.
+
.TP
.B \-xx \-B\fR
\- Adds serial number, voltage (if available). Note that \fBvolts\fR shows the
data (if available) as the voltage now / minimum design voltage.
+
.TP
.B \-xx \-C\fR
\- Adds \fBL1 cache:\fR and \fBL3 cache:\fR if either are available. Requires
dmidecode and sudo/root.
+
.TP
.B \-xx \-D\fR
\- Adds disk serial number.
@@ -711,11 +821,12 @@ For a PCIe 3 NVMe drive, with speed of \fB8 GT/s\fR and \fB4\fR lanes
(\fB8GT/s * 128/130 * 4 = 31.6 Gb/s\fR):
\fBspeed: 31.6 Gb/s lanes: 4\fR
+
.TP
.B \-xx \-G\fR
\- Adds vendor:product ID of each Graphics card.
-\- Adds compositor, if found (experimental).
+\- Adds Xorg compositor, if found (always shows for Wayland systems).
\- For free drivers, adds OpenGL compatibility version number if available.
For nonfree drivers, the core version and compatibility versions are usually
@@ -732,6 +843,10 @@ and loaded when checking the card. This can let you know there are other driver
Note that if you have explicitly set the driver in \fBxorg.conf\fR, Xorg will not
create this automatic check driver list.
+\- If available, shows Xorg dpi (\fBs-dpi:\fR) for the active Xorg \fBScreen\fR
+(not physical monitor). Note that the physical monitor dpi and the Xorg
+dpi are not necessarily the same thing, and can vary widely.
+
.TP
.B \-xx \-I\fR
\- Adds init type version number (and rc if present).
@@ -742,6 +857,16 @@ create this automatic check driver list.
type defaults.
\- Adds parent program (or tty) that started shell, if not IRC client.
+
+.TP
+.B \-xx \-j\fR (\fB\-\-swap\fR), \fB\-xx \-p\fR, \fB\-xx \-P\fR
+\- Adds swap priority to each swap partition (for \fB\-P\fR) used, and for all
+swap types (for \fB\-j\fR).
+
+.TP
+.B \-xx \-J\fR (\fB\-\-usb\fR)
+\- Adds vendor:chip id.
+
.TP
.B \-xx \-m\fR, \fB\-\-memory\-modules\fR
\- Adds memory device Manufacturer.
@@ -754,22 +879,27 @@ also shows serial number.
\- Adds single/double bank memory, if data is found. Note, this may not be 100% right
all of the time since it depends on the order that data is found in \fBdmidecode\fR
output for \fBtype 6\fR and \fBtype 17\fR.
+
.TP
.B \-xx \-M\fR
\- Adds chassis information, if data is available. Also shows BIOS
ROM size if using \fBdmidecode\fR.
+
.TP
.B \-xx \-N\fR
\- Adds vendor:product ID for each Network card.
+
.TP
.B \-xx \-R\fR
\- md\-raid: Adds superblock (if present) and algorithm. If resync,
shows progress bar.
\- Hardware RAID: Adds Chip vendor:product ID.
+
.TP
.B \-xx \-s\fR
\- Adds DIMM/SOC voltages, if present (\fBipmi\fR only).
+
.TP
.B \-xx \-S\fR
\- Adds display manager (\fBdm\fR) type, if present. If none, shows N/A.
@@ -783,21 +913,22 @@ If none found, shows nothing. Uses a less accurate fallback tool \fBwmctrl\fR
if \fBps\fR tests fail to find data.
\- Adds desktop toolkit (\fBtk\fR), if available (Xfce/KDE/Trinity).
+
.TP
.B \-xx \-\-slots\fR
\- Adds slot length.
-.TP
-.B \-xx \-\-usb\fR
-\- Adds vendor:chip id.
+
.TP
.B \-xx \-w\fR,\fB \-W\fR
\- Adds wind chill, heat index, and dew point, if available.
\- Adds cloud cover, rain, snow, or precipitation (amount in previous hour
to observation time), if available.
+
.TP
.B \-xxx \-A\fR
\- Adds, if present, serial number.
+
.TP
.B \-xxx \-B\fR
\- Adds battery chemistry (e.g. \fBLi\-ion\fR), cycles (NOTE: there appears to
@@ -807,10 +938,12 @@ data is simply not available as of 2018\-04\-03), location (only available from
\fBdmidecode\fR derived output).
\- Adds attached device \fBrechargeable: [yes|no]\fR information.
+
.TP
.B \-xxx \-C\fR
\- Adds \fBboost: [enabled|disabled]\fR if detected, aka \fBturbo\fR. Not all CPUs
have this feature.
+
.TP
.B \-xxx \-D\fR
\- Adds disk firmware revision number (if available).
@@ -822,15 +955,27 @@ able to detect all schemes, but handles the most common, e.g. \fBGPT\fR or \fBMB
Only appears if detected (SSD drives do not have rotation speeds, for example). If none
found, nothing shows. Not all disks report this speed, so even if they are spinnning,
no data will show.
+
.TP
.B \-xxx \-G\fR
-\- Adds (if available) \fBcompositor:\fR version \fBv:\fR.
+\- Adds (if available) Xorg \fBcompositor:\fR version \fBv:\fR (always shows if
+found for Wayland systems).
+
.TP
.B \-xxx \-I\fR
\- For \fBShell:\fR adds \fB(su|sudo|login)\fR to shell name if present.
\- For \fBrunning in:\fR adds \fB(SSH)\fR to parent, if present. SSH detection
uses the \fBwho am i\fR test.
+
+.TP
+.B \-xxx \-J\fR (\fB\-\-usb\fR)
+\- Adds, if present, serial number for non hub devices.
+
+\- Adds \fBinterfaces:\fR for non hub devices.
+
+\- Adds, if available, USB speed in \fBMbits/s\fR or \fBGbits/s\fR.
+
.TP
.B \-xxx \-m\fR, \fB\-\-memory\-modules\fR
\- Adds memory bus width: primary bus width, and if present, total width. e.g.
@@ -844,9 +989,11 @@ present. If no total width data is found, then inxi will not show that item.
data available.
\- Adds device serial number.
+
.TP
.B \-xxx \-N\fR
\- Adds, if present, serial number.
+
.TP
.B \-xxx \-R\fR
\- md\-raid: Adds system mdraid support types (kernel support, read ahead, RAID events)
@@ -855,6 +1002,7 @@ data available.
\- Hardware RAID: Adds rev, ports, and (if available and/or relevant)
\fBvendor:\fR item, which shows specific vendor [product] information.
+
.TP
.B \-xxx \-S\fR
\- Adds, if in X, or with \fB--display\fR, bar/dock/panel/tray items
@@ -864,13 +1012,7 @@ lxpanel, xfce4\-panel, lxqt\-panel, tint2, cairo-dock, trayer, and many others.
\- Adds (if present), window manager (\fBwm\fR) version number.
\- Adds (if present), display manager (\fBdm\fR) version number.
-.TP
-.B \-xxx \-\-usb\fR
-\- Adds, if present, serial number for non hub devices.
-\- Adds \fBinterfaces:\fR for non hub devices.
-
-\- Adds, if available, USB speed in \fBMbits/s\fR or \fBGbits/s\fR.
.TP
.B \-xxx \-w\fR,\fB \-W\fR
\- Adds location (city state country), observation altitude (if available),
@@ -906,7 +1048,7 @@ Using \fBsmartctl\fR (requires sudo/root privileges).
\- Adds SATA type (eg 1.0, 2.6, 3.0) if a SATA device.
\- Adds SMART report line: status, enabled/disabled, health, powered on,
-cycles, and some error cases if out of range values. Note that for Pre-fail items,
+cycles, and some error cases if out of range values. Note that for Pre\-fail items,
it will show the VALUE and THRESHOLD numbers. It will also fall back for unknown
attributes that are or have been failing and print out the Attribute name, value,
threshold, and failing message. This way even for unhandled Attribute names,
@@ -921,6 +1063,88 @@ sizes if necessary. Adds in drive temperature for some drives as well,
and other useful data.
.TP
+.B \-a \-G\fR
+Triggers a much more complete Screen/Monitor output on the
+\fBDisplay:\fR line of \fB\-G\fR. Note that the
+basic feature requires \fBxdpyinfo\fR, and the advanced per monitor
+feature requires \fBxrandr\fR.
+
+No support currently exists for \fBWayland\fR since we so far can find
+no documentation or easy methods to extract this information from \fBWayland\fR
+compositors. This unfortunate situation may change in the future, hopefully.
+However, most \fBWayland\fR systems also come with \fBxwayland\fR,
+which should supply the tools necessary for the time being.
+
+Further note that all references to \fBDisplays\fR, \fBScreens\fR,
+and \fBMonitors\fR are referring to the \fBX\fR technical terms,
+not normal consumer usage. 1 \fBDisplay\fR runs 1 or more
+\fBScreens\fR, and a \fBScreen\fR runs 1 or more \fBMonitors\fR.
+
+\- Adds \fBDisplay\fR ID, for the Display running the Screen that runs the Monitors.
+
+\- Adds total number of \fBScreens\fR listed for the current \fBDisplay\fR.
+
+\- Adds default \fBScreen\fR ID if Screen (not monitor!) total is greater than 1.
+
+\- Adds \fBScreen\fR line, which includes the ID (\fBScreen: 0\fR) then \fBs-res\fR
+(Screen resolution), \fBs\-dpi\fR, \fBs\-size\fR and \fBs\-diag\fR. Remember, this is an
+Xorg \fBScreen\fR, NOT a monitor screen, and the information listed is about
+the Xorg Screen! It may at times be the same as a single monitor system,
+but usually it's different in some ways.
+
+\- Adds \fBMonitor\fR ID(s). Monitors are a subset of a Screen, each of which
+can have one or more monitors. Normally a dual monitor setup is 2 monitors
+run by one Xorg Screen. Each monitor has the following data, if available:
+
+\- \fBres:\fR resolution in pixels. This is the individual monitor's
+reported pixel dimensions.
+
+\- \fBhz:\fR frequency in Herz, as reported to Xorg. Note that there have been
+and may continue to be bugs with how Xorg treats > 1 monitor frequencies.
+
+\- \fBdpi:\fR dpi (dots per inch), aka, ppi (pixels per inch). This is the
+physical screen dpi, which is calculated using the screen dimensions and its
+resolution.
+
+\- \fBsize:\fR size in mm (inches). Note that this is the real monitor size,
+not the Xorg Screen size, which can be quite different (1 Xorg Screen can
+for instance contain two or more monitors).
+
+\- \fBdiag:\fR monitor screen diagonal in mm (inches). Note that this is
+the real monitor size, not the Xorg full Screen diagonal size, which
+can be quite different.
+
+Sample (with both \fBxdpyinfo\fR and \fBxrandr\fR data available):
+.nf
+\fBinxi \-aG
+Graphics:
+ ....
+Display: x11 server: X.Org 1.20.6 driver: modesetting
+display ID: :0.0 screens: 1
+Screen\-1: 0 s\-res: 2560x1024 s\-dpi: 96 s\-size: 677x271mm (26.7x10.7")
+s\-diag: 729mm (28.7")
+Monitor\-1: DVI\-I\-0 res: 1280x1024 hz: 60 dpi: 96
+size: 338x270mm (13.3x10.6") diag: 433mm (17")
+Monitor\-2: VGA\-0 res: 1280x1024 hz: 60 dpi: 86
+size: 376x301mm (14.8x11.9") diag: 482mm (19")
+ ....
+.fi
+
+.TP
+.B \-a \-j\fR, \fB\-a \-P\fR , \fB\-a \-P\fR
+\- Adds swappiness and vfs cache pressure, and a message to indicate
+if the value is the default value or not (Linux only, and only if available).
+If not the default value, shows default value as well, e.g.
+
+For \fB\-P\fR per swap physical partition:
+
+\fBswappiness: 60 (default) cache pressure: 90 (default 100)\fR
+
+For \fB\-j\fR row 1 output:
+
+\fBKernel: swappiness: 60 (default) cache pressure: 90 (default 100)\fR
+
+.TP
.B \-a \-p\fR,\fB\-a \-P\fR
\- Adds raw partition size, including file system overhead, partition table, e.g.
@@ -935,12 +1159,6 @@ not the raw size.
\- Adds partition filesystem block size if found (requires root and blockdev).
-\- For swap, adds swappiness and vfs cache pressure, and a message to indicate
-if it is the default value or not (Linux only, and only if available). If not,
-shows default value as well, e.g.
-
-\fBswappiness: 60 (default) cache pressure: 90 (default 100)\fR.
-
.TP
.B \-a \-S\fR
\- Adds kernel boot parameters to \fBKernel\fR section (if detected). Support
@@ -976,6 +1194,11 @@ which is generally slower than \fBCurl\fR or \fBWget\fR but it may help bypass
issues with downloading.
.TP
+.B \-\-dig\fR
+Temporary override of \fBNO_DIG\fR configuration item. Only use to test w/wo dig.
+Restores default behavior for WAN IP, which is use dig if present.
+
+.TP
.B \-\-display [:<integer>]\fR
Will try to get display data out of X (does not usually work as root user).
Default gets display info from display \fB:0\fR. If you use the format
@@ -1028,6 +1251,12 @@ Updates / installs man page with \fB\-U\fR if \fBpinxi\fR or using \fB\-U 3\fR d
(Only active if \fB\-U\fR is is not disabled by maintainers).
.TP
+.B \-\-no\-dig\fR
+Overrides default use of \fBdig\fR to get WAN IP address. Allows use of normal
+downloader tool to get IP addresses. Only use if dig is failing, since dig is much
+faster and more reliable in general than other methods.
+
+.TP
.B \-\-no\-host\fR
Turns off hostname in System line. This is default when using \fB\-z\fR,
for anonymizing inxi output for posting on forums or IRC. Overrides
@@ -1048,7 +1277,7 @@ Disables man page install with \fB\-U\fR for master and active development branc
Skip SSL certificate checks for all downloader actions (\fB\-U\fR, \fB\-w\fR,
\fB\-W\fR, \fB\-i\fR). Use if your system does not have current SSL certificate
lists, or if you have problems making a connection for any reason. Works with
-\fBWget\fR, \fBCurl\fR, and \fBFetch\fR only.
+\fBWget\fR, \fBCurl\fR, \fBPerl HTTP::Tiny\fRand \fBFetch\fR.
.TP
.B \-\-no\-sudo\fR
@@ -1076,21 +1305,21 @@ configuration item. These are the available sort options:
\fBdev\-base\fR - \fB/dev\fR partition identifier, like \fB/dev/sda1\fR.
Note that it's an alphabetic sort, so \fBsda12\fR is before \fBsda2\fR.
-\fBfs\fR - Partition filesystem. Note that sorts will be somewhat random if all
+\fBfs\fR \- Partition filesystem. Note that sorts will be somewhat random if all
filesystems are the same.
-\fBid\fR - Mount point of partition (default).
+\fBid\fR \- Mount point of partition (default).
-\fBlabel\fR - Label of partition. If partitions have no labels,
+\fBlabel\fR \- Label of partition. If partitions have no labels,
sort will be random.
\fBpercent\-used\fR - Percentage of partition size used.
-\fBsize\fR - KiB size of partition.
+\fBsize\fR \- KiB size of partition.
-\fBuuid\fR - UUID of the partition.
+\fBuuid\fR \- UUID of the partition.
-\fBused\fR - KiB used of partition.
+\fBused\fR \- KiB used of partition.
.TP
.B \-\-pm\-type [package manager name]\fR
@@ -1141,7 +1370,7 @@ Forces the USB data generator to use \fBlsusb\fR as data source. Overrides
Force \fB\-i\fR to use supplied URL as WAN IP source. Overrides dig or
default IP source urls. URL must start with http[s] or ftp.
-The IP address from the URL must be the last item on the last (non-empty) line
+The IP address from the URL must be the last item on the last (non\-empty) line
of the page content source code.
Same as configuration value (example):
@@ -1162,6 +1391,12 @@ fetch. Shows more downloader action information. Shows some more information
for Perl downloader.
.TP
+.B \-\-dbg [2\-xx]\fR
+\- See github \fBinxi-perl/docs/inxi-values.txt\fR for specific specialized debugging
+options. These can vary but tend to not change much, though they are added as
+needed.
+
+.TP
.B \-\-debug [1\-3]\fR
\- On screen debugger output. Output varies depending on current needs
Usually nothing changes.
@@ -1338,6 +1573,9 @@ Overrides default. See \fB\-\-indent\-min\fR. If \fB80\fR or less, wrap will nev
\fBLIMIT\fR Overrides default of \fB10\fR IP addresses per IF. This is only of interest
to sys admins running servers with many IP addresses.
+\fBNO_DIG\fR Set to \fB1\fR or \fBtrue\fR to disable WAN IP use of \fBdig\fR and force
+use of alternate downloaders.
+
\fBNO_SUDO\fR Set to \fB1\fR or \fBtrue\fR to disable internal use of \fBsudo\fR.
\fBPARTITION_SORT\fR Overrides default partition output sort. See
@@ -1359,13 +1597,13 @@ generally much faster). URL must begin with http or ftp. Note that if you use th
the downloader set tests will run each time you start inxi whether a downloader feature
is going to be used or not.
-The IP address from the URL must be the last item on the last (non-empty) line of
+The IP address from the URL must be the last item on the last (non\-empty) line of
the URL's page content source code.
Same as \fB\-\-wan\-ip\-url [URL]\fR
\fBWEATHER_SOURCE\fR Values: [\fB0-9\fR]. Same as \fB\-\-weather\-source\fR. Values
-4-9 are not currently supported, but this can change at any time.
+4\-9 are not currently supported, but this can change at any time.
\fBWEATHER_UNIT\fR Values: [\fBc\fR|\fBf\fR|\fBcf\fR|\fBfc\fR]. Same as \fB\-\-weather\-unit\fR.
@@ -1428,7 +1666,7 @@ is a fork of \fBlocsmif\fR's very clever \fBinfobash\fR script.
Original infobash author and copyright holder:
Copyright (C) 2005\-2007 Michiel de Boer aka locsmif
-inxi version: Copyright (C) 2008\-18 Harald Hope
+inxi version: Copyright (C) 2008\-20 Harald Hope
This man page was originally created by Gordon Spencer (aka aus9) and is
maintained by Harald Hope (aka h2 or TechAdmin).
diff --git a/inxi.changelog b/inxi.changelog
index 89a8c18..eb5a208 100644
--- a/inxi.changelog
+++ b/inxi.changelog
@@ -1,4 +1,185 @@
=====================================================================================
+Version: 3.1.00
+Patch: 00
+Date: 2020-04-22
+-----------------------------------
+Changes:
+-----------------------------------
+New inxi, new man. Huge update, new line types, huge graphics upgrade, new
+switches, bug fixes, glitch fixes, enhancements, you name it, this has got it!!
+
+Note that since this features a new primary line item (-j / --swap Swap:),
+the version number has been bumped to 3.1.0, making this a major version
+upgrade, the first since the new Perl inxi rewrite was launched, though of
+course 3.0.0 contained many new line items as well, but this is the first
+actually new line item since then.
+
+Bugs:
+1. Big bug fix: if -z used, and -p, and user had partitions mounted in $HOME
+directory, the partitions would buggily duplicate in the output.
+
+2. See Fix 1, inxi was reporting the wrong (or no in some cases) Xorg driver
+because it was using the wrong Xorg log, it was only searcing in the original
+/var/log/Xorg.0.log file, not the newer alternative path locations.
+
+Fixes:
+1. Both an enhancement and a fix, users reported Xorg log file location changes.
+Fix is that now inxi uses wildcard searches of all readable locations that can
+contain the log files, then collects a list of them, and uses the last modified
+one. This ensures that the best possible guess is made about which actual
+log file is current, which should lead to significantly more reliable Xorg
+driver reports overall.
+
+Note that this fix works for user level and root level, it will always use the
+most recent readable file no matter what. For root, that should translate to
+the most recent on an absolute level Xorg log file. This issue was caused by
+gdm moving from Xorg.0.log to Xorg.1.log on some systems, but not all, and
+also, the location is often but not always now:
+~/.local/share/xorg/Xorg.[01234..].log [except for root, which is why
+root has to search for all user Xorg log files to find the most recent one.
+
+There were many red-herrings in this issue report, so it took some research to
+dig through those to the real data sources.
+
+2. Now that the compositor detection is out of early testing mode, enabled
+always on compositor detection for Wayland systems. Since the compositor
+is the Wayland display server, it makes sense to always show it if Wayland.
+Note that there is still no known way to actually reliably get Wayland data
+beyond simple environmental variables that let inxi detect Wayland is running
+the desktop. Lack of reliable logs or debugging tools across Wayland compositors
+makes this entire process about 10-50x more difficult than it should have been.
+
+3. In keeping with 2., also moved compositor: item to be right after server:
+item.
+
+4. Debian bug:
+https://bugs.debian.org/cgi-bin/pkgreport.cgi?dist=unstable;package=inxi
+requested that HTTP::Tiny be set to default always check SSL certificates.
+Now inxi does that, and --no-ssl flag disables this, which makes the Perl
+http downloader now work roughly the same as wget, curl, etc.
+
+5. Man page fixes, added pointer placeholders for out of alphabetical order
+options, so you can find anything by looking down the alpha sorted lists, like:
+--swap - See -j. Since inxi is running out of single letters that match new
+features, it's easier to point man readers to the right item without them
+having to already know it to find it. Also added --dbg [2-xx] pointer to
+github inxi-perl/docs/inxi-values.txt so people interested can learn how to
+trip the various per feature screen debuggers.
+
+Enhancements:
+1. updated ubuntu ids, added 'focal LTS'.
+
+2. USB Graphic devices added. This will add support for USB graphics adapters,
+an uncommon but existing category, often used in SOC boards, for example, but
+also on desktops, and things like USB webcams. Leaving these off was really
+just an oversight, the programming internally had the data, it just wasn't
+using it.
+
+3. Support added for TV card type multimedia devices in Graphics. That was
+actually a long term oversight, I'd simply missed that in the device ID
+documentation, one of the multimedia device subtypes is Video device.
+
+4. Huge, massive, internal upgrade to allow for -Ga output, which gives a
+technically accurate Xorg > Display > Screen > Monitor breakdown. Note that
+Display and Screen data come from xdpyinfo, and Monitor info comes from xrandr,
+but if xrandr is missing, the Screen information shows.
+
+Technically for -G, -Gxx, end users see very little difference except the per
+Screen / per Monitor resolutions are listed with a 1: type counter per item.
+
+Note that Xorg Screens are NOT Monitors, they are a virtual space Xorg constructs
+out of the pieces of hardware that make up the Screen space. In many cases,
+1 Xorg Screen contains only 1 Monitor, but the dimensions or dpi are frequenty
+different.
+
+New output items:
+Display: ... display ID: [Xorg Screen identifier, like :0.0]; screens: [Total Xorg
+Screens in current Display]; [s-default: [if > 1 Screens, default Screen number]]
+
+Screen-x: [Screen number]; s-res: [Xorg Screen resolution];
+s-dpi: [Xorg Screen dpi]; s-size: [Xorg Screen mm (inch) size;
+s-diag: [diagonal of Xorg Screen size]
+
+Monitor-x: [Monitor Xorg ID]; res: [Actual monitor pixel dimensions];
+hz: [actual monitor reported frequency]; dpi: [actual monitor dpi as calculated
+from actual monitor resolution/size; size: [actual monitor size in mm (inch);
+diag: [actual diagonal size in mm (inch).
+
+4a. -Gxx now shows Xorg s-dpi: for the Screen as well, after the main resolution
+section for -G.
+
+5. Big improvement in error messages and logging for Xorg driver detections,
+this logic is much more robust now, but after the main driver fix, also much less
+likely to ever be seen.
+
+6. Almost not visible to users, but major internal graphics refactor allows now
+for more modular treatment, and eventual Wayland data sourcing. Currently
+most Wayland data sourcing is in stub form, or only logically possible, but
+as it grows possible (if ever, since Wayland protocal appears to have totally
+neglected enforcing single location logging, and single tool debugging for
+the entire Wayland protocol of compositors, a massive oversight in my view).
+The -Ga refactors internally made this much more possible, and I integrated
+switches and tests, and fallbacks, and stubs in some locations, so it was
+clear where current Xorg specific logic is, and where future Wayland logic
+will fit in, sort of anyway.
+
+7. Debugger tools added for new features, or most of them.
+
+8. New primary line item: --swap / -j. This moves all swap data to a dedicated
+Swap: line, which looks roughly the same as Partition: lines, but when -j/--swap
+is used, all swap types, not only physical partition swaps, show. This should
+make some users happy.
+
+9. Added more cpu family IDs for Zen 2 series of cpu, tweaked some later
+Intel cpu family ids in terms of cpu arch name tool.
+
+10. By request, added ability filter out all UUID or Partition Label
+strings in -j, -o, -Sa, -p, -P. Those are tripped by --filter-label and
+--filter-uuid. Mostly useful in fringe cases, for example, replacing
+label or UUID from -Sa kernel boot parameters with root=LABEL=<filter>,
+or in cases you want to show full -v8 output without showing UUID or Labels,
+whatever.
+
+11. Added --no-dig/--dig plus configuration option NO_DIG=true. This disables
+dig in cases where dig is installed but failed due to maybe network firewall
+rules or something, and WAN IP detection fails. Normally you always want
+to use dig, it's faster, more reliable, and safer, than all the other regular
+downloader based methods, but we have seen server setups where for some reason
+those types of dig requests were blocked, thus disabling WAN IP detection.
+
+12. Added in WAN IP failure case, if dig was used, suggestion to try
+again with --no-dig, since most users are unlikely to learn about this issue,
+or the solution to it.
+
+13. Added single letter shortcut -J for --usb, maybe this will help people
+discover usb component of inxi, now you can request for instance: inxi -FJaz
+
+14. Added xonsh to supported shells, that had tripped a perl undefined value
+for start client bug since xonsh uses single word for version, xonsh/234
+so the default value, 2nd word, was undefined.
+
+15. More SSD and USB drive vendors from the endless fountain over at
+Linux Hardware Database (linuxliteos.com).
+
+Changes:
+1. Small change in how screen resolutions are output in -G non -a mode,
+now each Screen / Monitor will increment by 1 the 1: [resolution~hz] key.
+This helps make it more readable. Note that in non -a mode, the increments
+are just based on Screen, then Monitor, Monitor, Screen, and so on, counts.
+Most users will only have one Screen systems, but more advanced setups may use
+the Xorg > 1 Screen, each screen able to run > 1 monitors.
+
+The counts in say, a 2 Screen system, with 3 monitors, would be:
+1: res1 [from screen 0, monitor 1] 2: res2 [from screen 0, monitor 2]
+3: res3 [from screen 1, monitor 1.
+
+If xrandr is not installed, it would show:
+1: res1 [from screen 0] 2: res2 [from screen 1]
+
+-----------------------------------
+-- Harald Hope - Wed, 22 Apr 2020 19:33:56 -0700
+
+=====================================================================================
Version: 3.0.38
Patch: 00
Date: 2020-03-14