New version, new man. Weather explanations, disks, bugs!!

Bugs:
1. For sensors, in some cases, gpu failed to show correctly. This
should be corrected.

Fixes:
1. Made help/man explanations of weather changes more clear.
Particularly in regards to no automated query info. But also for supported
location syntaxes.
2. Some corner cases of null weather data return null and tripped
a null data error. This is corrected.
3. Added city duplicate filter to weather output, this hopefully will
in some cases avoid printing city name twice, depends on weather source.
4. Removed --weather-source option 0, that no longer works so all code was
removed.
5. More deb822 fixes, loosened up even more syntax. That's a poorly designed
config syntax, hard to work with.

Enhancements:
1. Lots of new disk vendors. So many!! Thanks linux-lite hardware database!
switched to a new method of getting disk name/vendor data, now it's a lot easier
to check for new ones.
2. Added fancybar to desktop info.
This commit is contained in:
Harald Hope 2019-03-29 14:11:22 -07:00
parent 1f037020e3
commit 2650a51d3b
3 changed files with 145 additions and 68 deletions

139
inxi
View file

@ -31,8 +31,8 @@ use POSIX qw(uname strftime ttyname);
## INXI INFO ## ## INXI INFO ##
my $self_name='inxi'; my $self_name='inxi';
my $self_version='3.0.32'; my $self_version='3.0.33';
my $self_date='2019-02-07'; my $self_date='2019-03-29';
my $self_patch='00'; my $self_patch='00';
## END INXI INFO ## ## END INXI INFO ##
@ -2512,7 +2512,8 @@ sub check_items {
} }
else { else {
@data = qw(blockdev dig dmidecode fdisk file hddtemp ifconfig ip ipmitool @data = qw(blockdev dig dmidecode fdisk file hddtemp ifconfig ip ipmitool
ipmi-sensors lsblk lsusb modinfo runlevel sensors strings sudo tree upower uptime); ipmi-sensors lsblk lsusb modinfo runlevel sensors smartctl strings sudo
tree upower uptime);
} }
$b_program = 1; $b_program = 1;
$item = 'Program'; $item = 'Program';
@ -2858,8 +2859,8 @@ sub item_data {
'rpm' => 'lm-sensors', 'rpm' => 'lm-sensors',
}), }),
'smartctl' => ({ 'smartctl' => ({
'info' => '-Dx show hdd temp', 'info' => '-Dxx rotation (alt), type, smart',
'info-bsd' => '-Dx show hdd temp', 'info-bsd' => '-Dx rotation (alt), type, smart',
'apt' => '', 'apt' => '',
'pacman' => '', 'pacman' => '',
'rpm' => '', 'rpm' => '',
@ -4074,7 +4075,7 @@ sub get_options{
my ($opt,$arg) = @_; my ($opt,$arg) = @_;
# let api processor handle checks if valid, this # let api processor handle checks if valid, this
# future proofs this # future proofs this
if ($arg =~ /^[0-9]$/){ if ($arg =~ /^[1-9]$/){
$weather_source = $arg; $weather_source = $arg;
} }
else { else {
@ -4550,14 +4551,15 @@ sub show_options {
if ( $b_weather ){ if ( $b_weather ){
@rows = ( @rows = (
['1', '-w', '--weather', "Local weather data/time. To check an alternate ['1', '-w', '--weather', "Local weather data/time. To check an alternate
location, see -W."], location, see -W. NO AUTOMATED QUERIES ALLOWED!"],
['1', '-W', '--weather-location', "[location] Supported options for ['1', '-W', '--weather-location', "[location] Supported options for
[location]: postal code[,country]; city, state/country; latitude, longitude. [location]: postal code[,country/country code]; city, state (USA)/country
Only use if you want the weather somewhere other than the machine running (country/two character country code); latitude, longitude. Only use if you
$self_name. Use only ASCII characters, replace spaces in city/state/country want the weather somewhere other than the machine running $self_name. Use
names with '+'. Example:^$self_name^-W^new+york,ny"], only ASCII characters, replace spaces in city/state/country names with '+'.
['1', '', '--weather-source', "[0-9] Change weather data source. 0 uses Example:^$self_name^-W^[new+york,ny^london,gb^madrid,es]"],
a legacy source internally. 1-3 generally active, 4-9 check. See man."], ['1', '', '--weather-source', "[1-9] Change weather data source. 1-4 generally
active, 5-9 check. See man."],
['1', '', '--weather-unit', "Set weather units to metric (m), imperial (i), ['1', '', '--weather-unit', "Set weather units to metric (m), imperial (i),
metric/imperial (mi), or imperial/metric (im)."], metric/imperial (mi), or imperial/metric (im)."],
); );
@ -5454,7 +5456,7 @@ sub row_defaults {
'unknown-desktop-version' => "ERR-101", 'unknown-desktop-version' => "ERR-101",
'unknown-dev' => "ERR-102", 'unknown-dev' => "ERR-102",
'unknown-shell' => "ERR-100", 'unknown-shell' => "ERR-100",
'weather-error' => "Error in weather data: $id", 'weather-error' => "Error: $id",
'weather-null' => "No $id found. Internet connection working?", 'weather-null' => "No $id found. Internet connection working?",
'xdpyinfo-missing' => '<xdpyinfo missing>', 'xdpyinfo-missing' => '<xdpyinfo missing>',
); );
@ -8735,7 +8737,7 @@ sub device_vendor {
['^STEC\b','^STEC\b','STEC',''], # ssd drive, must come before seagate ST test ['^STEC\b','^STEC\b','STEC',''], # ssd drive, must come before seagate ST test
# real, SSEAGATE Backup+; XP1600HE30002 | 024 HN (spinpoint) # real, SSEAGATE Backup+; XP1600HE30002 | 024 HN (spinpoint)
['(^ST[^T]|[S]?SEAGATE|^X[AFP]|^5AS|^BUP|Expansion Desk|FreeAgent|GoFlex|Backup(\+|\s?Plus)\s?Hub)','[S]?SEAGATE','Seagate',''], ['(^ST[^T]|[S]?SEAGATE|^X[AFP]|^5AS|^BUP|Expansion Desk|FreeAgent|GoFlex|Backup(\+|\s?Plus)\s?Hub)','[S]?SEAGATE','Seagate',''],
['^(WD|Western Digital|My (Book|Passport)|\d*LPCX|Elements|M000|EARX|EFRX|\d*EAVS|0JD|JPVX|[0-9]+(BEV|(00)?AAK|AAV|AZL))','(^WDC|Western\s?Digital)','Western Digital',''], ['^(WD|WL[0]9]|Western Digital|My (Book|Passport)|\d*LPCX|Elements|M000|EARX|EFRX|\d*EAVS|0JD|JPVX|[0-9]+(BEV|(00)?AAK|AAV|AZL))','(^WDC|Western\s?Digital)','Western Digital',''],
## Then better known ones ## ## Then better known ones ##
['^(A-DATA|ADATA|AXN|CH11)','^(A-DATA|ADATA)','A-Data',''], ['^(A-DATA|ADATA|AXN|CH11)','^(A-DATA|ADATA)','A-Data',''],
['^ADTRON','^(ADTRON)','Adtron',''], ['^ADTRON','^(ADTRON)','Adtron',''],
@ -8747,7 +8749,6 @@ sub device_vendor {
# note: 2012: wdc bought hgst # note: 2012: wdc bought hgst
['^(HGST|Touro|5450)','^HGST','HGST (Hitachi)',''], # HGST HUA ['^(HGST|Touro|5450)','^HGST','HGST (Hitachi)',''], # HGST HUA
['^(Hitachi|HD[ST]|DK[0-9]|IC|HT|HU)','^Hitachi','Hitachi',''], ['^(Hitachi|HD[ST]|DK[0-9]|IC|HT|HU)','^Hitachi','Hitachi',''],
['^Hoodisk','^Hoodisk','Hoodisk',''],
# vb: VB0250EAVER but clashes with vbox; HP_SSD_S700_120G ;GB0500EAFYL GB starter too generic? # vb: VB0250EAVER but clashes with vbox; HP_SSD_S700_120G ;GB0500EAFYL GB starter too generic?
['^(HP\b|MB0|G[BJ]0|v[0-9]{3}[ow])','^HP','HP',''], ['^(HP\b|MB0|G[BJ]0|v[0-9]{3}[ow])','^HP','HP',''],
['^(LSD|Lexar|JumpDrive|JD\s?Firefly)','^Lexar','Lexar',''], # mmc-LEXAR_0xb016546c; JD Firefly; ['^(LSD|Lexar|JumpDrive|JD\s?Firefly)','^Lexar','Lexar',''], # mmc-LEXAR_0xb016546c; JD Firefly;
@ -8764,15 +8765,20 @@ sub device_vendor {
# unknown: AL25744_12345678; ADP may be usb 2.5" adapter; udisk unknown: Z1E6FTKJ 00AAKS # unknown: AL25744_12345678; ADP may be usb 2.5" adapter; udisk unknown: Z1E6FTKJ 00AAKS
# SSD2SC240G726A10 MRS020A128GTS25C EHSAJM0016GB # SSD2SC240G726A10 MRS020A128GTS25C EHSAJM0016GB
['^5ACE','^5ACE','5ACE',''], # could be seagate: ST316021 5ACE ['^5ACE','^5ACE','5ACE',''], # could be seagate: ST316021 5ACE
['^Aireye','^Aireye','Aireye',''],
['^Android','^Android','Android',''], ['^Android','^Android','Android',''],
['^Apotop','^Apotop','Apotop',''],
# must come before AP|Apacer # must come before AP|Apacer
['^APPLE','^APPLE','Apple',''], ['^APPLE','^APPLE','Apple',''],
['^(AP|Apacer)','^Apacer','Apacer',''], ['^(AP|Apacer)','^Apacer','Apacer',''],
['^(ASM|2115)','^ASM','ASMedia',''],#asm1153e ['^(ASM|2115)','^ASM','ASMedia',''],#asm1153e
['^Bell\b','^Bell','Packard Bell',''],
['^BHT','^BHT','BHT',''], ['^BHT','^BHT','BHT',''],
['^BIOSTAR','^BIOSTAR','Biostar',''],
['^BIWIN','^BIWIN','BIWIN',''], ['^BIWIN','^BIWIN','BIWIN',''],
['^BUFFALO','^BUFFALO','Buffalo',''], ['^BUFFALO','^BUFFALO','Buffalo',''],
['^CHN\b','','Zheino',''], ['^CHN\b','','Zheino',''],
['^Clover','^Clover','Clover',''],
['^Colorful\b','^Colorful','Colorful',''], ['^Colorful\b','^Colorful','Colorful',''],
['^CSD','^CSD','CSD',''], ['^CSD','^CSD','CSD',''],
['^(Dane-?Elec|Z Mate)','^Dane-?Elec','DaneElec',''], ['^(Dane-?Elec|Z Mate)','^Dane-?Elec','DaneElec',''],
@ -8780,6 +8786,8 @@ sub device_vendor {
['^DeLOCK','^Delock(\s?products)?','Delock',''], ['^DeLOCK','^Delock(\s?products)?','Delock',''],
['^DGM','^DGM\b','DGM',''], ['^DGM','^DGM\b','DGM',''],
['^DIGITAL\s?FILM','DIGITAL\s?FILM','Digital Film',''], ['^DIGITAL\s?FILM','DIGITAL\s?FILM','Digital Film',''],
['^Dogfish','^Dogfish','Dogfish',''],
['^DragonDiamond','^DragonDiamond','DragonDiamond',''],
['^DREVO\b','^DREVO','Drevo',''], ['^DREVO\b','^DREVO','Drevo',''],
['^(Eaget|V8$)','^Eaget','Eaget',''], ['^(Eaget|V8$)','^Eaget','Eaget',''],
['^EDGE','^EDGE','EDGE',''], ['^EDGE','^EDGE','EDGE',''],
@ -8791,6 +8799,7 @@ sub device_vendor {
['^FORESEE','^FORESEE','Foresee',''], ['^FORESEE','^FORESEE','Foresee',''],
['^GALAX\b','^GALAX','GALAX',''], ['^GALAX\b','^GALAX','GALAX',''],
['^Galaxy\b','^Galaxy','Galaxy',''], ['^Galaxy\b','^Galaxy','Galaxy',''],
['^Geil','^Geil','Geil',''],
['^Generic','^Generic','Generic',''], ['^Generic','^Generic','Generic',''],
['^Gigabyte','^Gigabyte','Gigabyte',''], # SSD ['^Gigabyte','^Gigabyte','Gigabyte',''], # SSD
['^Gigastone','^Gigastone','Gigastone',''], ['^Gigastone','^Gigastone','Gigastone',''],
@ -8798,6 +8807,8 @@ sub device_vendor {
['^(GOODRAM|IR SSD)','^GOODRAM','GOODRAM',''], ['^(GOODRAM|IR SSD)','^GOODRAM','GOODRAM',''],
# supertalent also has FM: |FM # supertalent also has FM: |FM
['^(G[\.]?SKILL)','^G[\.]?SKILL','G.SKILL',''], ['^(G[\.]?SKILL)','^G[\.]?SKILL','G.SKILL',''],
['^Hectron','^Hectron','Hectron',''],
['^Hoodisk','^Hoodisk','Hoodisk',''],
['^HUAWEI','^HUAWEI','Huawei',''], ['^HUAWEI','^HUAWEI','Huawei',''],
['^(IBM|DT)','^IBM','IBM',''], ['^(IBM|DT)','^IBM','IBM',''],
['^IEI Tech','^IEI Tech(\.|nology)?( Corp(\.|oration)?)?','IEI Technology',''], ['^IEI Tech','^IEI Tech(\.|nology)?( Corp(\.|oration)?)?','IEI Technology',''],
@ -8822,9 +8833,10 @@ sub device_vendor {
['^Lenovo','^Lenovo','Lenovo',''], ['^Lenovo','^Lenovo','Lenovo',''],
['^RPFT','','Lenovo O.E.M.',''], ['^RPFT','','Lenovo O.E.M.',''],
['^(LITE[\-\s]?ON[\s\-]?IT)','^LITE[\-]?ON[\s\-]?IT','LITE-ON IT',''], # LITEONIT_LSS-24L6G ['^(LITE[\-\s]?ON[\s\-]?IT)','^LITE[\-]?ON[\s\-]?IT','LITE-ON IT',''], # LITEONIT_LSS-24L6G
['^(LITE[\-\s]?ON|PH6)','^LITE[\-]?ON','LITE-ON',''], # PH6-CE240-L ['^(LITE[\-\s]?ON|PH[1-9])','^LITE[\-]?ON','LITE-ON',''], # PH6-CE240-L
['^M-Systems','^M-Systems','M-Systems',''], ['^M-Systems','^M-Systems','M-Systems',''],
['^(MAXTOR)','^MAXTOR','Maxtor',''], # note M3 is usually maxtor, but can be samsung ['^(MAXTOR|Atlas)','^MAXTOR','Maxtor',''], # note M3 is usually maxtor, but can be samsung
['^Memorex','^Memorex','Memorex',''],
# note: C300/400 can be either micron or crucial, but C400 is M4 from crucial # note: C300/400 can be either micron or crucial, but C400 is M4 from crucial
['(^MT|^M5|^Micron|00-MT|C[34]00)','^Micron','Micron',''],# C400-MTFDDAK128MAM ['(^MT|^M5|^Micron|00-MT|C[34]00)','^Micron','Micron',''],# C400-MTFDDAK128MAM
['^MARVELL','^MARVELL','Marvell',''], ['^MARVELL','^MARVELL','Marvell',''],
@ -8832,10 +8844,13 @@ sub device_vendor {
['^Medion','^Medion','Medion',''], ['^Medion','^Medion','Medion',''],
['^(MEDIAMAX|WL[0-9]{2})','^MEDIAMAX','MediaMax',''], ['^(MEDIAMAX|WL[0-9]{2})','^MEDIAMAX','MediaMax',''],
['^Motorola','^Motorola','Motorola',''], ['^Motorola','^Motorola','Motorola',''],
['^MTRON','^MTRON','MTRON',''],
['^Netac','^Netac','Netac',''], ['^Netac','^Netac','Netac',''],
['^OOS[1-9]','','Utania',''], ['^OOS[1-9]','','Utania',''],
['^PALIT','PALIT','Palit',''], # ssd ['^PALIT','PALIT','Palit',''], # ssd
['^PERC\b','','Dell PowerEdge RAID Card',''], # ssd
['^(PS[8F]|Patriot)','^Patriot([-\s]?Memory)?','Patriot',''], ['^(PS[8F]|Patriot)','^Patriot([-\s]?Memory)?','Patriot',''],
['^Pioneer','Pioneer','Pioneer',''],
['^PIX[\s]?JR','^PIX[\s]?JR','Disney',''], ['^PIX[\s]?JR','^PIX[\s]?JR','Disney',''],
['^(PLEXTOR|PX-)','^PLEXTOR','Plextor',''], ['^(PLEXTOR|PX-)','^PLEXTOR','Plextor',''],
['^(PQI|Intelligent\s?Stick)','^PQI','PQI',''], ['^(PQI|Intelligent\s?Stick)','^PQI','PQI',''],
@ -8846,13 +8861,18 @@ sub device_vendor {
['^RENICE','^RENICE','Renice',''], ['^RENICE','^RENICE','Renice',''],
['^(Ricoh|R5)','^Ricoh','Ricoh',''], ['^(Ricoh|R5)','^Ricoh','Ricoh',''],
['^RIM[\s]','^RIM','RIM',''], ['^RIM[\s]','^RIM','RIM',''],
['^Runcore','^Runcore','Runcore',''],
['^Sage','^Sage(\s?Micro)?','Sage Micro',''],
['^SigmaTel','^SigmaTel','SigmaTel',''], ['^SigmaTel','^SigmaTel','SigmaTel',''],
['^(Silicon\s?Power|SPPC|Silicon)','Silicon\s?Power','Silicon Power',''], # DIAMOND_040_GB
['^(SILICON\s?MOTION|SM[0-9])','^SILICON\s?MOTION','Silicon Motion',''],
['^(Silicon\s?Power|SP[CP]C|Silicon|Diamond|Haspeed)','Silicon\s?Power','Silicon Power',''],
['Smartbuy','\s?Smartbuy','Smartbuy',''], # SSD Smartbuy 60GB ['Smartbuy','\s?Smartbuy','Smartbuy',''], # SSD Smartbuy 60GB
# HFS128G39TND-N210A; seen nvme with name in middle # HFS128G39TND-N210A; seen nvme with name in middle
['(SK\s?HYNIX|^HFS)','\s?SK\s?HYNIX','SK Hynix',''], ['(SK\s?HYNIX|^HFS)','\s?SK\s?HYNIX','SK Hynix',''],
['hynix','hynix','Hynix',''],# nvme middle of string, must be after sk hynix ['hynix','hynix','Hynix',''],# nvme middle of string, must be after sk hynix
['^SH','','Smart Modular Tech.',''], ['^SH','','Smart Modular Tech.',''],
['^Skill','^Skill','Skill',''],
['^(SMART( Storage Systems)?|TX)','^(SMART( Storage Systems)?)','Smart Storage Systems',''], ['^(SMART( Storage Systems)?|TX)','^(SMART( Storage Systems)?)','Smart Storage Systems',''],
['^(S[FR]-|Sony)','^Sony','Sony',''], ['^(S[FR]-|Sony)','^Sony','Sony',''],
['^STE[CK]','^STE[CK]','sTec',''], # wd bought this one ['^STE[CK]','^STE[CK]','sTec',''], # wd bought this one
@ -8867,6 +8887,8 @@ sub device_vendor {
['^(TDK|TF[1-9][0-9])','^TDK','TDK',''], ['^(TDK|TF[1-9][0-9])','^TDK','TDK',''],
['^TEAC','^TEAC','TEAC',''], ['^TEAC','^TEAC','TEAC',''],
['^TEAM','^TEAM( Group)?','Team',''], ['^TEAM','^TEAM( Group)?','Team',''],
['^Teclast','^Teclast','Teclast',''],
['^Teleplan','^Teleplan','Teleplan',''],
['^Tigo','^Tigo','Tigo',''], ['^Tigo','^Tigo','Tigo',''],
['^TopSunligt','^TopSunligt','TopSunligt',''], # is this a typo? hard to know ['^TopSunligt','^TopSunligt','TopSunligt',''], # is this a typo? hard to know
['^TopSunlight','^TopSunlight','TopSunlight',''], ['^TopSunlight','^TopSunlight','TopSunlight',''],
@ -8881,6 +8903,8 @@ sub device_vendor {
['^VISIONTEK','^VISIONTEK','VisionTek',''], ['^VISIONTEK','^VISIONTEK','VisionTek',''],
['^VMware','^VMware','VMware',''], ['^VMware','^VMware','VMware',''],
['^(Vseky|Vaseky)','^Vaseky','Vaseky',''], # ata-Vseky_V880_350G_ ['^(Vseky|Vaseky)','^Vaseky','Vaseky',''], # ata-Vseky_V880_350G_
['^(YUCUN|R880)','^YUCUN','YUCUN',''],
['^ZTC','^ZTC','ZTC',''],
['^(ASMT|2115)','^ASMT','ASMT (case)',''], ['^(ASMT|2115)','^ASMT','ASMT (case)',''],
); );
foreach my $ref (@vendors){ foreach my $ref (@vendors){
@ -13329,7 +13353,12 @@ sub get_repos_linux {
@apt_working = (); @apt_working = ();
$b_apt_enabled = 1; $b_apt_enabled = 1;
foreach my $row (@data2){ foreach my $row (@data2){
next if $row =~ /^\s+/; # deb822 supports line folding which starts with space # NOTE: the syntax of deb822 must be considered a bug, it's sloppy beyond belief.
# deb822 supports line folding which starts with space
# BUT: you can start a URIs: block of urls with a space, sigh.
next if $row =~ /^\s+/ && $row !~ /^\s+[^#]+:\//;
# strip out line space starters now that it's safe
$row =~ s/^\s+//;
#print "$row\n"; #print "$row\n";
if ($row eq '~'){ if ($row eq '~'){
if (@apt_working && $b_apt_enabled){ if (@apt_working && $b_apt_enabled){
@ -14366,6 +14395,7 @@ sub lm_sensors_data {
#my $file = "$ENV{'HOME'}/bin/scripts/inxi/data/sensors/sensors-asus-chassis-1.txt"; #my $file = "$ENV{'HOME'}/bin/scripts/inxi/data/sensors/sensors-asus-chassis-1.txt";
#my $file = "$ENV{'HOME'}/bin/scripts/inxi/data/sensors/sensors-devnull-1.txt"; #my $file = "$ENV{'HOME'}/bin/scripts/inxi/data/sensors/sensors-devnull-1.txt";
#my $file = "$ENV{'HOME'}/bin/scripts/inxi/data/sensors/sensors-jammin1.txt"; #my $file = "$ENV{'HOME'}/bin/scripts/inxi/data/sensors/sensors-jammin1.txt";
# my $file = "$ENV{'HOME'}/bin/scripts/inxi/data/sensors/sensors-maximus-arch-1.txt";
# @sensors_data = main::reader($file); # @sensors_data = main::reader($file);
# print join ("\n", @sensors_data), "\n"; # print join ("\n", @sensors_data), "\n";
@sensors_data = map {$_ =~ s/\s*:\s*\+?/:/;$_} @sensors_data; @sensors_data = map {$_ =~ s/\s*:\s*\+?/:/;$_} @sensors_data;
@ -14562,7 +14592,6 @@ sub sysctl_data {
} }
last if /^(hw.cpuspeed|hw.vendor|hw.physmem)/; last if /^(hw.cpuspeed|hw.vendor|hw.physmem)/;
} }
%sensors = data_processor(%sensors) if %sensors; %sensors = data_processor(%sensors) if %sensors;
main::log_data('dump','%sensors',\%sensors) if $b_log; main::log_data('dump','%sensors',\%sensors) if $b_log;
# print Data::Dumper::Dumper \%sensors; # print Data::Dumper::Dumper \%sensors;
@ -14930,12 +14959,14 @@ sub gpu_data {
$holder = ''; $holder = '';
} }
if ($b_found){ if ($b_found){
if (/^temp.*:([0-9]+).*(C|F)/){
$gpudata[$j]{'temp'} = $1;
$gpudata[$j]{'type'} = $holder; $gpudata[$j]{'type'} = $holder;
if (/^[^:]*:([0-9]+).*\b(C|F)\s/i){
$gpudata[$j]{'temp'} = $1;
$gpudata[$j]{'unit'} = $2; $gpudata[$j]{'unit'} = $2;
# print "$_\n";
} }
if (/^fan.*:([0-9]+).*(RPM)?/){ # speeds can be in percents or rpms, so need the 'fan' in regex
if (/^.*fan.*:([0-9]+).*(RPM)?/i){
$gpudata[$j]{'fan-speed'} = $1; $gpudata[$j]{'fan-speed'} = $1;
# NOTE: we test for nvidia %, everything else stays with nothing # NOTE: we test for nvidia %, everything else stays with nothing
$gpudata[$j]{'speed-unit'} = ''; $gpudata[$j]{'speed-unit'} = '';
@ -15460,7 +15491,16 @@ sub create_output {
if ($weather{'sunset'}){ if ($weather{'sunset'}){
$rows[0]{main::key($num++,'Sunset')} = $weather{'sunset'}; $rows[0]{main::key($num++,'Sunset')} = $weather{'sunset'};
} }
if ($weather{'moonphase'}){
$value = $weather{'moonphase'} . '%';
$value .= ($weather{'moonphase-graphic'}) ? ' ' . $weather{'moonphase-graphic'} :'';
$rows[0]{main::key($num++,'Moonphase')} = $value;
} }
if ($weather{'forecast'}){
$rows[0]{main::key($num++,'Forecast')} = $weather{'forecast'};
}
}
if ($weather{'api-source'}){ if ($weather{'api-source'}){
$rows[0]{main::key($num++,'Source')} = $weather{'api-source'}; $rows[0]{main::key($num++,'Source')} = $weather{'api-source'};
} }
@ -15631,6 +15671,9 @@ sub get_weather {
elsif ( $working[0] eq 'error' ){ elsif ( $working[0] eq 'error' ){
$weather{'error'} = $working[1]; $weather{'error'} = $working[1];
} }
elsif ( $working[0] eq 'forecast' ){
$weather{'forecast'} = $working[1];
}
elsif ( $working[0] eq 'heat_index_string' ){ elsif ( $working[0] eq 'heat_index_string' ){
$weather{'heat-index'} = $working[1]; $weather{'heat-index'} = $working[1];
$working[1] =~ /^([0-9\.]+)\sF\s\(([0-9\.]+)\sC\)/; $working[1] =~ /^([0-9\.]+)\sF\s\(([0-9\.]+)\sC\)/;
@ -15653,6 +15696,12 @@ sub get_weather {
elsif ( $working[0] eq 'local_epoch' ){ elsif ( $working[0] eq 'local_epoch' ){
$weather{'local-epoch'} = $working[1]; $weather{'local-epoch'} = $working[1];
} }
elsif ( $working[0] eq 'moonphase' ){
$weather{'moonphase'} = $working[1];
}
elsif ( $working[0] eq 'moonphase_graphic' ){
$weather{'moonphase-graphic'} = $working[1];
}
elsif ( $working[0] eq 'observation_time_rfc822' ){ elsif ( $working[0] eq 'observation_time_rfc822' ){
$weather{'observation-time-rfc822'} = $working[1]; $weather{'observation-time-rfc822'} = $working[1];
} }
@ -15792,25 +15841,25 @@ sub get_weather {
# remote timezone for this local block only # remote timezone for this local block only
local $ENV{'TZ'} = $tz if $tz; local $ENV{'TZ'} = $tz if $tz;
$date_time = POSIX::strftime "%c", localtime(); $date_time = POSIX::strftime "%c", localtime();
$date_time = test_local_date($date_time,'',''); $date_time = test_locale_date($date_time,'','');
$weather{'date-time'} = $date_time; $weather{'date-time'} = $date_time;
# only wu has rfc822 value, and we want the original observation time then # only wu has rfc822 value, and we want the original observation time then
if ($weather{'observation-epoch'} && $tz){ if ($weather{'observation-epoch'} && $tz){
$date_time = POSIX::strftime "%Y-%m-%d %T ($tz %z)", localtime($weather{'observation-epoch'}); $date_time = POSIX::strftime "%Y-%m-%d %T ($tz %z)", localtime($weather{'observation-epoch'});
$date_time = test_local_date($date_time,$show{'weather-location'},$weather{'observation-epoch'}); $date_time = test_locale_date($date_time,$show{'weather-location'},$weather{'observation-epoch'});
$weather{'observation-time-local'} = $date_time; $weather{'observation-time-local'} = $date_time;
} }
} }
else { else {
$date_time = POSIX::strftime "%c", localtime(); $date_time = POSIX::strftime "%c", localtime();
$date_time = test_local_date($date_time,'',''); $date_time = test_locale_date($date_time,'','');
$tz = ( $location[2] ) ? " ($location[2])" : ''; $tz = ( $location[2] ) ? " ($location[2])" : '';
$weather{'date-time'} = $date_time . $tz; $weather{'date-time'} = $date_time . $tz;
} }
# we get the wrong time using epoch for remote -W location # we get the wrong time using epoch for remote -W location
if ( !$show{'weather-location'} && $weather{'observation-epoch'}){ if ( !$show{'weather-location'} && $weather{'observation-epoch'}){
$date_time = POSIX::strftime "%c", localtime($weather{'observation-epoch'}); $date_time = POSIX::strftime "%c", localtime($weather{'observation-epoch'});
$date_time = test_local_date($date_time,$show{'weather-location'},$weather{'observation-epoch'}); $date_time = test_locale_date($date_time,$show{'weather-location'},$weather{'observation-epoch'});
$weather{'observation-time-local'} = $date_time; $weather{'observation-time-local'} = $date_time;
} }
return %weather; return %weather;
@ -15819,14 +15868,9 @@ sub get_weather {
sub download_weather { sub download_weather {
eval $start if $b_log; eval $start if $b_log;
my ($now,$file_cached,@location) = @_; my ($now,$file_cached,@location) = @_;
my (@weather,@weather_temp,$temp,$ua,$url); my (@weather,$temp,$ua,$url);
if ($weather_source == 0){
$url = "http://api.wunderground.com/auto/wui/geo/WXCurrentObXML/index.xml?query=$location[0]";
}
else {
$url = "https://smxi.org/opt/xr2.php?loc=$location[0]&src=$weather_source"; $url = "https://smxi.org/opt/xr2.php?loc=$location[0]&src=$weather_source";
} $ua = 'weather';
$ua = 'weather' if $url =~ /smxi/;
# { # {
# #my $file2 = "$ENV{'HOME'}/bin/scripts/inxi/data/weather/weather-1.xml"; # #my $file2 = "$ENV{'HOME'}/bin/scripts/inxi/data/weather/weather-1.xml";
# # my $file2 = "$ENV{'HOME'}/bin/scripts/inxi/data/weather/feed-oslo-1.xml"; # # my $file2 = "$ENV{'HOME'}/bin/scripts/inxi/data/weather/feed-oslo-1.xml";
@ -15836,24 +15880,7 @@ sub download_weather {
# $temp = <$fh>; # $temp = <$fh>;
# } # }
$temp = main::download_file('stdout',$url,'',$ua); $temp = main::download_file('stdout',$url,'',$ua);
$temp =~ s/\r|\n\n/\n/g if $weather_source == 0; @weather = split(/\n/, $temp) if $temp;
@weather_temp = split /\n/, $temp;
if ($weather_source == 0){
foreach (@weather_temp){
chomp $_;
$_ =~ s/<\/[^>]+>//;
$_ =~ s/.*icon.*|\r//g;
$_ =~ s/\s\s/ /g;
$_ =~ s/^\s+|\s+$//g;
$_ =~ s/>/^^/;
$_ =~ s/^<|NA$//g;
$_ =~ s/^(current|credit|terms|image|title|link|.*_url).*//;
push @weather, $_ if $_ !~ /^\s*$/;
}
}
else {
@weather = @weather_temp;
}
unshift (@weather,("timestamp^^$now")); unshift (@weather,("timestamp^^$now"));
main::writer($file_cached,\@weather); main::writer($file_cached,\@weather);
#print "$file_cached: download/cleaned\n"; #print "$file_cached: download/cleaned\n";
@ -15862,7 +15889,7 @@ sub download_weather {
} }
# resolve wide character issue, if detected, switch to iso # resolve wide character issue, if detected, switch to iso
# date format, we won't try to be too clever here. # date format, we won't try to be too clever here.
sub test_local_date { sub test_locale_date {
my ($date_time,$location,$epoch) = @_; my ($date_time,$location,$epoch) = @_;
# $date_time .= 'дек'; # $date_time .= 'дек';
#print "1: $date_time\n"; #print "1: $date_time\n";
@ -15973,7 +16000,7 @@ sub complete_location {
if ($location && $location =~ /[\+\-0-9]/ && $city){ if ($location && $location =~ /[\+\-0-9]/ && $city){
$location = $country . ', ' . $location if $country && $location !~ m|$country|i; $location = $country . ', ' . $location if $country && $location !~ m|$country|i;
$location = $state . ', ' . $location if $state && $location !~ m|$state|i; $location = $state . ', ' . $location if $state && $location !~ m|$state|i;
$location = $city . ', ' . $location; $location = $city . ', ' . $location if $city && $location !~ m|$city|i;
} }
eval $end if $b_log; eval $end if $b_log;
return $location; return $location;
@ -16566,7 +16593,7 @@ sub set_info_data {
my (@data,@info,$item); my (@data,@info,$item);
my $pattern = 'alltray|awn|bar|bmpanel|bmpanel2|budgie-panel|cairo-dock|'; my $pattern = 'alltray|awn|bar|bmpanel|bmpanel2|budgie-panel|cairo-dock|';
$pattern .= 'dde-dock|dmenu|dockbarx|docker|docky|dzen|dzen2|'; $pattern .= 'dde-dock|dmenu|dockbarx|docker|docky|dzen|dzen2|';
$pattern .= 'fbpanel|fspanel|glx-dock|gnome-panel|hpanel|i3bar|icewmtray|'; $pattern .= 'fancybar|fbpanel|fspanel|glx-dock|gnome-panel|hpanel|i3bar|icewmtray|';
$pattern .= 'kdocker|kicker|'; $pattern .= 'kdocker|kicker|';
$pattern .= 'latte|latte-dock|lemonbar|ltpanel|lxpanel|lxqt-panel|'; $pattern .= 'latte|latte-dock|lemonbar|ltpanel|lxpanel|lxqt-panel|';
$pattern .= 'matchbox-panel|mate-panel|ourico|'; $pattern .= 'matchbox-panel|mate-panel|ourico|';

35
inxi.1
View file

@ -1,4 +1,4 @@
.TH INXI 1 "2019\-02\-07" inxi "inxi manual" .TH INXI 1 "2019\-03\-29" inxi "inxi manual"
.SH NAME .SH NAME
inxi \- Command line system information script for console and IRC inxi \- Command line system information script for console and IRC
.SH SYNOPSIS .SH SYNOPSIS
@ -462,29 +462,44 @@ Adds weather line. Note, this depends on an unreliable API so it may not always
be working in the future. To get weather for an alternate location, use be working in the future. To get weather for an alternate location, use
\fB\-W\fR. See also \fB\-x\fR, \fB\-xx\fR, \fB\-xxx\fR options. \fB\-W\fR. See also \fB\-x\fR, \fB\-xx\fR, \fB\-xxx\fR options.
Please note that your distribution's maintainer may chose to disable this feature. Please note that your distribution's maintainer may chose to disable this feature.
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 .TP
.B \-W\fR, \fB\-\-weather\-location <location_string>\fR .B \-W\fR, \fB\-\-weather\-location <location_string>\fR
Get weather/time for an alternate location. Accepts postal/zip code[, country], Get weather/time for an alternate location. Accepts postal/zip code[, country],
city,state pair, or latitude,longitude. Note: city/country/state names must not city,state pair, or latitude,longitude. Note: city/country/state names must not
contain spaces. Replace spaces with '\fB+\fR' sign. Don't place spaces around contain spaces. Replace spaces with '\fB+\fR' sign. Don't place spaces around
any commas. Postal code is not reliable except for North America and maybe the UK. any commas. Postal code is not reliable except for North America and maybe the UK.
Try postal codes with and without country code added. Try postal codes with and without country code added. Note that City,State applies
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
country codes.
Use only ASCII letters in city/state/country names. Use only ASCII letters in city/state/country names.
Examples: \fB\-W 95623,us\fR OR \fB\-W Boston,MA\fR OR Examples: \fB\-W 95623,us\fR OR \fB\-W Boston,MA\fR OR
\fB\-W 45.5234,\-122.6762\fR OR \fB\-W new+york,ny\fR OR \fB\-W bodo,norway\fR. \fB\-W 45.5234,\-122.6762\fR OR \fB\-W new+york,ny\fR OR \fB\-W bodo,norway\fR.
DO NOT USE THIS FEATURE FOR AUTOMATED WEATHER UPDATES! Use of automated queries,
will result in your access being blocked.
.TP .TP
.B \-\-weather\-source\fR, \fB\-\-ws <unit>\fR .B \-\-weather\-source\fR, \fB\-\-ws <unit>\fR
[\fB0\-9\fR] Switches weather data source. 0 uses a legacy source which may vanish [\fB0\-9\fR] Switches weather data source. Possible values are \fB1\-9\fR. \fB1\-4\fR
any day. \fB1\-9\fR use different remote sources. \fB2\fR may not support city / will generally be active, and \fB5\-9\fR may or may not be active, so check.
country names with spaces (even if you use the \fB+\fR sign instead of space). \fB1\fR may not support city / country names with spaces (even if you use the \fB+\fR
\fB3\fR offers pretty good data, but may not have all small city names for sign instead of space). \fB2\fR offers pretty good data, but may not have all small
\fB\-W\fR. city names for \fB\-W\fR.
More data sources will be added as time permits, so try each one and Please note that the data sources are not static per value, and can change any time,
see which you prefer. If you get unsupported source message, it means that number or be removed, so always test to verify which source is being used for each value
has not been implemented. 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 .TP
.B \-\-weather\-unit <unit>\fR .B \-\-weather\-unit <unit>\fR
[\fBm\fR|\fBi\fR|\fBmi\fR|\fBim\fR] Sets weather units to metric (\fBm\fR), imperial (\fBi\fR), [\fBm\fR|\fBi\fR|\fBmi\fR|\fBim\fR] Sets weather units to metric (\fBm\fR), imperial (\fBi\fR),

View file

@ -1,3 +1,38 @@
=====================================================================================
Version: 3.0.33
Patch: 00
Date: 2019-03-29
-----------------------------------
Changes:
-----------------------------------
New version, new man. Weather explanations, disks, bugs!!
Bugs:
1. For sensors, in some cases, gpu failed to show correctly. This
should be corrected.
Fixes:
1. Made help/man explanations of weather changes more clear.
Particularly in regards to no automated query info. But also for supported
location syntaxes.
2. Some corner cases of null weather data return null and tripped
a null data error. This is corrected.
3. Added city duplicate filter to weather output, this hopefully will
in some cases avoid printing city name twice, depends on weather source.
4. Removed --weather-source option 0, that no longer works so all code was
removed.
5. More deb822 fixes, loosened up even more syntax. That's a poorly designed
config syntax, hard to work with.
Enhancements:
1. Lots of new disk vendors. So many!! Thanks linux-lite hardware database!
switched to a new method of getting disk name/vendor data, now it's a lot easier
to check for new ones.
2. Added fancybar to desktop info.
-----------------------------------
-- Harald Hope - Fri, 29 Mar 2019 14:03:51 -0700
===================================================================================== =====================================================================================
Version: 3.0.32 Version: 3.0.32
Patch: 00 Patch: 00