Register
It is currently Mon Apr 23, 2018 6:50 pm

inxi weather report


All times are UTC - 6 hours


Post new topic Reply to topic  [ 2 posts ] 
Author Message
 PostPosted: Mon Mar 13, 2017 10:30 pm   

Joined: Mon Mar 13, 2017 9:34 pm
Posts: 1
I created a script to extract weather results from inxi for 20 zip codes and all is good. I created a .desktop file to run the script and inxi choked. I have isolated the problem as follows, and the first question is a head scratching 'How come?' The second question is 'What to do about it?'

From the command line:
[email protected] ~ $ inxi -xxx -W 98563
Weather: Conditions: 51 F (11 C) - Overcast Wind: Calm Humidity: 100%
Pressure: 30.02 in (1016 mb) Location: Montesano WA (US) Altitude: 19 ft
Time: March 13, 8:59 PM PDT Observation Time: March 13, 8:53 PM PDT

Notice the 'Location', that's where the problem is.

This is my test script (/media/Avocet/Data/bin/testing.scr):
#!/bin/bash
inxi -xxx -W 98563 >> testfile.txt

I run it from the command line and the testfile.txt contents are the same three lines as above.

Here's the .desktop file:
[Desktop Entry]
Name=Weather
Comment=selected zip codes
Type=Application
Exec=/media/Avocet/Data/bin/testing.scr
Icon=/media/Avocet/Data/Icons/weather-rain.png

I run the .desktop file either from the menu or by directly clicking on it and get these results:

Weather: Conditions: 51 F (11 C) - Overcast Wind: Calm Humidity: 100%
Pressure: 30.02 in (1016 mb) Time: March 13, 9:06 PM PDT Observation Time: March 13, 8:53 PM PDT

Drat! Where's the "Location'? When I'm doing 20 zip codes the it's rather important. Fortunately the lack of location won't cause any famine or pestilence, but it does trouble my mind.

Your thoughts are appreciated,
Mike

Edit: The above results were on Mint/Mate. I got the same results on Solus/Budgie and LMDE/Cinnamon, which have different inxi versions. Also, I change inxi color defaults to 'no color' so that text files don't get corrupted with color codes. Systems with inxi defaults should add a -c0 switch (that's -c zero).


Top
 Profile  
 PostPosted: Tue Mar 14, 2017 4:54 pm   

Joined: Mon Oct 20, 2014 9:53 am
Posts: 574
First of all: Use proper indentation.
Press "Full editor" and click "Code".
It is unreadable otherwise.

Don't know what's going on here. Try debugging.

Use something like
Code:
set -vx

   # your code here
   inxi .....       | tee /some/path/debug-inxi-command.txt
} 1>>/some/path/debug.txt  2>>/some/path/debug-err.txt


Top
 Profile  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 2 posts ] 

All times are UTC - 6 hours


Who is online

Users browsing this forum: No registered users and 22 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Jump to:  
cron


BashScripts | Promote Your Page Too
Powered by phpBB © 2011 phpBB Group
© 2003 - 2011 USA LINUX USERS GROUP