mirror of
https://github.com/smxi/inxi.git
synced 2024-11-16 16:21:39 +00:00
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:
parent
1f037020e3
commit
2650a51d3b
139
inxi
139
inxi
|
@ -31,8 +31,8 @@ use POSIX qw(uname strftime ttyname);
|
|||
|
||||
## INXI INFO ##
|
||||
my $self_name='inxi';
|
||||
my $self_version='3.0.32';
|
||||
my $self_date='2019-02-07';
|
||||
my $self_version='3.0.33';
|
||||
my $self_date='2019-03-29';
|
||||
my $self_patch='00';
|
||||
## END INXI INFO ##
|
||||
|
||||
|
@ -2512,7 +2512,8 @@ sub check_items {
|
|||
}
|
||||
else {
|
||||
@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;
|
||||
$item = 'Program';
|
||||
|
@ -2858,8 +2859,8 @@ sub item_data {
|
|||
'rpm' => 'lm-sensors',
|
||||
}),
|
||||
'smartctl' => ({
|
||||
'info' => '-Dx show hdd temp',
|
||||
'info-bsd' => '-Dx show hdd temp',
|
||||
'info' => '-Dxx rotation (alt), type, smart',
|
||||
'info-bsd' => '-Dx rotation (alt), type, smart',
|
||||
'apt' => '',
|
||||
'pacman' => '',
|
||||
'rpm' => '',
|
||||
|
@ -4074,7 +4075,7 @@ sub get_options{
|
|||
my ($opt,$arg) = @_;
|
||||
# let api processor handle checks if valid, this
|
||||
# future proofs this
|
||||
if ($arg =~ /^[0-9]$/){
|
||||
if ($arg =~ /^[1-9]$/){
|
||||
$weather_source = $arg;
|
||||
}
|
||||
else {
|
||||
|
@ -4550,14 +4551,15 @@ sub show_options {
|
|||
if ( $b_weather ){
|
||||
@rows = (
|
||||
['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
|
||||
[location]: postal code[,country]; city, state/country; latitude, longitude.
|
||||
Only use if you want the weather somewhere other than the machine running
|
||||
$self_name. Use only ASCII characters, replace spaces in city/state/country
|
||||
names with '+'. Example:^$self_name^-W^new+york,ny"],
|
||||
['1', '', '--weather-source', "[0-9] Change weather data source. 0 uses
|
||||
a legacy source internally. 1-3 generally active, 4-9 check. See man."],
|
||||
[location]: postal code[,country/country code]; city, state (USA)/country
|
||||
(country/two character country code); latitude, longitude. Only use if you
|
||||
want the weather somewhere other than the machine running $self_name. Use
|
||||
only ASCII characters, replace spaces in city/state/country names with '+'.
|
||||
Example:^$self_name^-W^[new+york,ny^london,gb^madrid,es]"],
|
||||
['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),
|
||||
metric/imperial (mi), or imperial/metric (im)."],
|
||||
);
|
||||
|
@ -5454,7 +5456,7 @@ sub row_defaults {
|
|||
'unknown-desktop-version' => "ERR-101",
|
||||
'unknown-dev' => "ERR-102",
|
||||
'unknown-shell' => "ERR-100",
|
||||
'weather-error' => "Error in weather data: $id",
|
||||
'weather-error' => "Error: $id",
|
||||
'weather-null' => "No $id found. Internet connection working?",
|
||||
'xdpyinfo-missing' => '<xdpyinfo missing>',
|
||||
);
|
||||
|
@ -8735,7 +8737,7 @@ sub device_vendor {
|
|||
['^STEC\b','^STEC\b','STEC',''], # ssd drive, must come before seagate ST test
|
||||
# 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',''],
|
||||
['^(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 ##
|
||||
['^(A-DATA|ADATA|AXN|CH11)','^(A-DATA|ADATA)','A-Data',''],
|
||||
['^ADTRON','^(ADTRON)','Adtron',''],
|
||||
|
@ -8747,7 +8749,6 @@ sub device_vendor {
|
|||
# note: 2012: wdc bought hgst
|
||||
['^(HGST|Touro|5450)','^HGST','HGST (Hitachi)',''], # HGST HUA
|
||||
['^(Hitachi|HD[ST]|DK[0-9]|IC|HT|HU)','^Hitachi','Hitachi',''],
|
||||
['^Hoodisk','^Hoodisk','Hoodisk',''],
|
||||
# vb: VB0250EAVER but clashes with vbox; HP_SSD_S700_120G ;GB0500EAFYL GB starter too generic?
|
||||
['^(HP\b|MB0|G[BJ]0|v[0-9]{3}[ow])','^HP','HP',''],
|
||||
['^(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
|
||||
# SSD2SC240G726A10 MRS020A128GTS25C EHSAJM0016GB
|
||||
['^5ACE','^5ACE','5ACE',''], # could be seagate: ST316021 5ACE
|
||||
['^Aireye','^Aireye','Aireye',''],
|
||||
['^Android','^Android','Android',''],
|
||||
['^Apotop','^Apotop','Apotop',''],
|
||||
# must come before AP|Apacer
|
||||
['^APPLE','^APPLE','Apple',''],
|
||||
['^(AP|Apacer)','^Apacer','Apacer',''],
|
||||
['^(ASM|2115)','^ASM','ASMedia',''],#asm1153e
|
||||
['^Bell\b','^Bell','Packard Bell',''],
|
||||
['^BHT','^BHT','BHT',''],
|
||||
['^BIOSTAR','^BIOSTAR','Biostar',''],
|
||||
['^BIWIN','^BIWIN','BIWIN',''],
|
||||
['^BUFFALO','^BUFFALO','Buffalo',''],
|
||||
['^CHN\b','','Zheino',''],
|
||||
['^Clover','^Clover','Clover',''],
|
||||
['^Colorful\b','^Colorful','Colorful',''],
|
||||
['^CSD','^CSD','CSD',''],
|
||||
['^(Dane-?Elec|Z Mate)','^Dane-?Elec','DaneElec',''],
|
||||
|
@ -8780,6 +8786,8 @@ sub device_vendor {
|
|||
['^DeLOCK','^Delock(\s?products)?','Delock',''],
|
||||
['^DGM','^DGM\b','DGM',''],
|
||||
['^DIGITAL\s?FILM','DIGITAL\s?FILM','Digital Film',''],
|
||||
['^Dogfish','^Dogfish','Dogfish',''],
|
||||
['^DragonDiamond','^DragonDiamond','DragonDiamond',''],
|
||||
['^DREVO\b','^DREVO','Drevo',''],
|
||||
['^(Eaget|V8$)','^Eaget','Eaget',''],
|
||||
['^EDGE','^EDGE','EDGE',''],
|
||||
|
@ -8791,6 +8799,7 @@ sub device_vendor {
|
|||
['^FORESEE','^FORESEE','Foresee',''],
|
||||
['^GALAX\b','^GALAX','GALAX',''],
|
||||
['^Galaxy\b','^Galaxy','Galaxy',''],
|
||||
['^Geil','^Geil','Geil',''],
|
||||
['^Generic','^Generic','Generic',''],
|
||||
['^Gigabyte','^Gigabyte','Gigabyte',''], # SSD
|
||||
['^Gigastone','^Gigastone','Gigastone',''],
|
||||
|
@ -8798,6 +8807,8 @@ sub device_vendor {
|
|||
['^(GOODRAM|IR SSD)','^GOODRAM','GOODRAM',''],
|
||||
# supertalent also has FM: |FM
|
||||
['^(G[\.]?SKILL)','^G[\.]?SKILL','G.SKILL',''],
|
||||
['^Hectron','^Hectron','Hectron',''],
|
||||
['^Hoodisk','^Hoodisk','Hoodisk',''],
|
||||
['^HUAWEI','^HUAWEI','Huawei',''],
|
||||
['^(IBM|DT)','^IBM','IBM',''],
|
||||
['^IEI Tech','^IEI Tech(\.|nology)?( Corp(\.|oration)?)?','IEI Technology',''],
|
||||
|
@ -8822,9 +8833,10 @@ sub device_vendor {
|
|||
['^Lenovo','^Lenovo','Lenovo',''],
|
||||
['^RPFT','','Lenovo O.E.M.',''],
|
||||
['^(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',''],
|
||||
['^(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
|
||||
['(^MT|^M5|^Micron|00-MT|C[34]00)','^Micron','Micron',''],# C400-MTFDDAK128MAM
|
||||
['^MARVELL','^MARVELL','Marvell',''],
|
||||
|
@ -8832,10 +8844,13 @@ sub device_vendor {
|
|||
['^Medion','^Medion','Medion',''],
|
||||
['^(MEDIAMAX|WL[0-9]{2})','^MEDIAMAX','MediaMax',''],
|
||||
['^Motorola','^Motorola','Motorola',''],
|
||||
['^MTRON','^MTRON','MTRON',''],
|
||||
['^Netac','^Netac','Netac',''],
|
||||
['^OOS[1-9]','','Utania',''],
|
||||
['^PALIT','PALIT','Palit',''], # ssd
|
||||
['^PERC\b','','Dell PowerEdge RAID Card',''], # ssd
|
||||
['^(PS[8F]|Patriot)','^Patriot([-\s]?Memory)?','Patriot',''],
|
||||
['^Pioneer','Pioneer','Pioneer',''],
|
||||
['^PIX[\s]?JR','^PIX[\s]?JR','Disney',''],
|
||||
['^(PLEXTOR|PX-)','^PLEXTOR','Plextor',''],
|
||||
['^(PQI|Intelligent\s?Stick)','^PQI','PQI',''],
|
||||
|
@ -8846,13 +8861,18 @@ sub device_vendor {
|
|||
['^RENICE','^RENICE','Renice',''],
|
||||
['^(Ricoh|R5)','^Ricoh','Ricoh',''],
|
||||
['^RIM[\s]','^RIM','RIM',''],
|
||||
['^Runcore','^Runcore','Runcore',''],
|
||||
['^Sage','^Sage(\s?Micro)?','Sage Micro',''],
|
||||
['^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
|
||||
# HFS128G39TND-N210A; seen nvme with name in middle
|
||||
['(SK\s?HYNIX|^HFS)','\s?SK\s?HYNIX','SK Hynix',''],
|
||||
['hynix','hynix','Hynix',''],# nvme middle of string, must be after sk hynix
|
||||
['^SH','','Smart Modular Tech.',''],
|
||||
['^Skill','^Skill','Skill',''],
|
||||
['^(SMART( Storage Systems)?|TX)','^(SMART( Storage Systems)?)','Smart Storage Systems',''],
|
||||
['^(S[FR]-|Sony)','^Sony','Sony',''],
|
||||
['^STE[CK]','^STE[CK]','sTec',''], # wd bought this one
|
||||
|
@ -8867,6 +8887,8 @@ sub device_vendor {
|
|||
['^(TDK|TF[1-9][0-9])','^TDK','TDK',''],
|
||||
['^TEAC','^TEAC','TEAC',''],
|
||||
['^TEAM','^TEAM( Group)?','Team',''],
|
||||
['^Teclast','^Teclast','Teclast',''],
|
||||
['^Teleplan','^Teleplan','Teleplan',''],
|
||||
['^Tigo','^Tigo','Tigo',''],
|
||||
['^TopSunligt','^TopSunligt','TopSunligt',''], # is this a typo? hard to know
|
||||
['^TopSunlight','^TopSunlight','TopSunlight',''],
|
||||
|
@ -8881,6 +8903,8 @@ sub device_vendor {
|
|||
['^VISIONTEK','^VISIONTEK','VisionTek',''],
|
||||
['^VMware','^VMware','VMware',''],
|
||||
['^(Vseky|Vaseky)','^Vaseky','Vaseky',''], # ata-Vseky_V880_350G_
|
||||
['^(YUCUN|R880)','^YUCUN','YUCUN',''],
|
||||
['^ZTC','^ZTC','ZTC',''],
|
||||
['^(ASMT|2115)','^ASMT','ASMT (case)',''],
|
||||
);
|
||||
foreach my $ref (@vendors){
|
||||
|
@ -13329,7 +13353,12 @@ sub get_repos_linux {
|
|||
@apt_working = ();
|
||||
$b_apt_enabled = 1;
|
||||
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";
|
||||
if ($row eq '~'){
|
||||
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-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-maximus-arch-1.txt";
|
||||
# @sensors_data = main::reader($file);
|
||||
# print join ("\n", @sensors_data), "\n";
|
||||
@sensors_data = map {$_ =~ s/\s*:\s*\+?/:/;$_} @sensors_data;
|
||||
|
@ -14562,7 +14592,6 @@ sub sysctl_data {
|
|||
}
|
||||
last if /^(hw.cpuspeed|hw.vendor|hw.physmem)/;
|
||||
}
|
||||
|
||||
%sensors = data_processor(%sensors) if %sensors;
|
||||
main::log_data('dump','%sensors',\%sensors) if $b_log;
|
||||
# print Data::Dumper::Dumper \%sensors;
|
||||
|
@ -14930,12 +14959,14 @@ sub gpu_data {
|
|||
$holder = '';
|
||||
}
|
||||
if ($b_found){
|
||||
if (/^temp.*:([0-9]+).*(C|F)/){
|
||||
$gpudata[$j]{'temp'} = $1;
|
||||
$gpudata[$j]{'type'} = $holder;
|
||||
if (/^[^:]*:([0-9]+).*\b(C|F)\s/i){
|
||||
$gpudata[$j]{'temp'} = $1;
|
||||
$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;
|
||||
# NOTE: we test for nvidia %, everything else stays with nothing
|
||||
$gpudata[$j]{'speed-unit'} = '';
|
||||
|
@ -15460,7 +15491,16 @@ sub create_output {
|
|||
if ($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'}){
|
||||
$rows[0]{main::key($num++,'Source')} = $weather{'api-source'};
|
||||
}
|
||||
|
@ -15631,6 +15671,9 @@ sub get_weather {
|
|||
elsif ( $working[0] eq 'error' ){
|
||||
$weather{'error'} = $working[1];
|
||||
}
|
||||
elsif ( $working[0] eq 'forecast' ){
|
||||
$weather{'forecast'} = $working[1];
|
||||
}
|
||||
elsif ( $working[0] eq 'heat_index_string' ){
|
||||
$weather{'heat-index'} = $working[1];
|
||||
$working[1] =~ /^([0-9\.]+)\sF\s\(([0-9\.]+)\sC\)/;
|
||||
|
@ -15653,6 +15696,12 @@ sub get_weather {
|
|||
elsif ( $working[0] eq 'local_epoch' ){
|
||||
$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' ){
|
||||
$weather{'observation-time-rfc822'} = $working[1];
|
||||
}
|
||||
|
@ -15792,25 +15841,25 @@ sub get_weather {
|
|||
# remote timezone for this local block only
|
||||
local $ENV{'TZ'} = $tz if $tz;
|
||||
$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;
|
||||
# only wu has rfc822 value, and we want the original observation time then
|
||||
if ($weather{'observation-epoch'} && $tz){
|
||||
$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;
|
||||
}
|
||||
}
|
||||
else {
|
||||
$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])" : '';
|
||||
$weather{'date-time'} = $date_time . $tz;
|
||||
}
|
||||
# we get the wrong time using epoch for remote -W location
|
||||
if ( !$show{'weather-location'} && $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;
|
||||
}
|
||||
return %weather;
|
||||
|
@ -15819,14 +15868,9 @@ sub get_weather {
|
|||
sub download_weather {
|
||||
eval $start if $b_log;
|
||||
my ($now,$file_cached,@location) = @_;
|
||||
my (@weather,@weather_temp,$temp,$ua,$url);
|
||||
if ($weather_source == 0){
|
||||
$url = "http://api.wunderground.com/auto/wui/geo/WXCurrentObXML/index.xml?query=$location[0]";
|
||||
}
|
||||
else {
|
||||
my (@weather,$temp,$ua,$url);
|
||||
$url = "https://smxi.org/opt/xr2.php?loc=$location[0]&src=$weather_source";
|
||||
}
|
||||
$ua = 'weather' if $url =~ /smxi/;
|
||||
$ua = 'weather';
|
||||
# {
|
||||
# #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";
|
||||
|
@ -15836,24 +15880,7 @@ sub download_weather {
|
|||
# $temp = <$fh>;
|
||||
# }
|
||||
$temp = main::download_file('stdout',$url,'',$ua);
|
||||
$temp =~ s/\r|\n\n/\n/g if $weather_source == 0;
|
||||
@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;
|
||||
}
|
||||
@weather = split(/\n/, $temp) if $temp;
|
||||
unshift (@weather,("timestamp^^$now"));
|
||||
main::writer($file_cached,\@weather);
|
||||
#print "$file_cached: download/cleaned\n";
|
||||
|
@ -15862,7 +15889,7 @@ sub download_weather {
|
|||
}
|
||||
# resolve wide character issue, if detected, switch to iso
|
||||
# date format, we won't try to be too clever here.
|
||||
sub test_local_date {
|
||||
sub test_locale_date {
|
||||
my ($date_time,$location,$epoch) = @_;
|
||||
# $date_time .= 'дек';
|
||||
#print "1: $date_time\n";
|
||||
|
@ -15973,7 +16000,7 @@ sub complete_location {
|
|||
if ($location && $location =~ /[\+\-0-9]/ && $city){
|
||||
$location = $country . ', ' . $location if $country && $location !~ m|$country|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;
|
||||
return $location;
|
||||
|
@ -16566,7 +16593,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 .= 'fbpanel|fspanel|glx-dock|gnome-panel|hpanel|i3bar|icewmtray|';
|
||||
$pattern .= 'fancybar|fbpanel|fspanel|glx-dock|gnome-panel|hpanel|i3bar|icewmtray|';
|
||||
$pattern .= 'kdocker|kicker|';
|
||||
$pattern .= 'latte|latte-dock|lemonbar|ltpanel|lxpanel|lxqt-panel|';
|
||||
$pattern .= 'matchbox-panel|mate-panel|ourico|';
|
||||
|
|
35
inxi.1
35
inxi.1
|
@ -1,4 +1,4 @@
|
|||
.TH INXI 1 "2019\-02\-07" inxi "inxi manual"
|
||||
.TH INXI 1 "2019\-03\-29" inxi "inxi manual"
|
||||
.SH NAME
|
||||
inxi \- Command line system information script for console and IRC
|
||||
.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
|
||||
\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.
|
||||
|
||||
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],
|
||||
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
|
||||
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.
|
||||
|
||||
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.
|
||||
|
||||
DO NOT USE THIS FEATURE FOR AUTOMATED WEATHER UPDATES! Use of automated queries,
|
||||
will result in your access being blocked.
|
||||
.TP
|
||||
.B \-\-weather\-source\fR, \fB\-\-ws <unit>\fR
|
||||
[\fB0\-9\fR] Switches weather data source. 0 uses a legacy source which may vanish
|
||||
any day. \fB1\-9\fR use different remote sources. \fB2\fR may not support city /
|
||||
country names with spaces (even if you use the \fB+\fR sign instead of space).
|
||||
\fB3\fR offers pretty good data, but may not have all small city names for
|
||||
\fB\-W\fR.
|
||||
[\fB0\-9\fR] Switches weather data source. Possible values are \fB1\-9\fR. \fB1\-4\fR
|
||||
will generally be active, and \fB5\-9\fR may or may not be active, so check.
|
||||
\fB1\fR may not support city / country names with spaces (even if you use the \fB+\fR
|
||||
sign instead of space). \fB2\fR offers pretty good data, but may not have all small
|
||||
city names for \fB\-W\fR.
|
||||
|
||||
More data sources will be added as time permits, so try each one and
|
||||
see which you prefer. If you get unsupported source message, it means that number
|
||||
has not been implemented.
|
||||
Please note that the data sources are not static per value, and can change any time,
|
||||
or be removed, so always test to verify which source is being used for each value
|
||||
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),
|
||||
|
|
|
@ -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
|
||||
Patch: 00
|
||||
|
|
Loading…
Reference in a new issue