add more weather locations
#1
sorry stupid question: How would I add more weather locations to the weather script, for example my home town Zurich, Switzerland? Thanks!
  Reply
#2
Greetings,

The shell script is "/usr/bin/sxmo_weather.sh" which points to the file "/usr/share/sxmo/appcfg/places_for_gps.tsv"
  Reply
#3
Hello,
Open your Browser and type "http://wttr.in" or "http://wttr.in/Paris" ;-)
SXMO Peoples working on this...

Ciao
Walter
  Reply
#4
(06-20-2021, 07:31 AM)walter1950 Wrote: Hello,
Open your Browser and type "http://wttr.in" or "http://wttr.in/Paris" ;-)
SXMO Peoples working on this...

Ciao
Walter
thank you Wink  my plan is to learn about those shell scripts.. I am coming from MacOS, so it's quite unusual.
  Reply
#5
(06-18-2021, 11:25 PM)discogribbs Wrote: Greetings,

The shell script is "/usr/bin/sxmo_weather.sh" which points to the file "/usr/share/sxmo/appcfg/places_for_gps.tsv"
true, but the script refers to a wheather service with U.S. Locations only. I don't think I can add simply my Europe address, as the weather service will not know it.
  Reply
#6
(05-14-2021, 01:33 AM)Uturn Wrote: sorry stupid question: How would I add more weather locations to the weather script, for example my home town Zurich, Switzerland? Thanks!

Maybe a bit late, you can just create your own userscript:

Install dependency
Code:
sudo apk install ansiweather
Create the userscript:
Code:
nano ~/.config/sxmo/userscripts/weather.sh
With following content:

Code:
#!/bin/sh
#title="ansiweather"

# Edit to your town:
LOCATION=Qeshm

# This fetches the Weather info:
WEATHER="ansiweather -l $LOCATION -a false -d true | sed 's/-/\n-/g' | sed 's/^-//'"

# Open a new shell and execute the command
sxmo_terminal.sh -- bash -c "${WEATHER}; exec bash"


exit 0
make it executable:
 
Code:
sudo chmod +x ~/.config/sxmo/userscripts/weather.sh


Now you cen select from Scripts menu in sxmo Smile
  Reply
#7
(06-20-2021, 11:31 PM)Uturn Wrote: my plan is to learn about those shell scripts.. I am coming from MacOS, so it's quite unusual.
Note that macOS actually also supports shell scripts. Most of its users just are not aware of that. But you can learn shell scripting on macOS if you wish. Or you can actually SSH from your Mac into the PinePhone and shell script your PinePhone from the Mac.

Or of course you could install GNU/Linux on the Mac. Smile But doing that is not necessary to be able to use a *nix (Unix-like) shell, because macOS is also a *nix (even a certified Unix™, though that is only of limited practical relevance, an uncertified GNU/Linux tends to be more compatible with the typical traditional Unix system than the Unix-certified macOS).

It is unfortunate that Apple tries really hard to hide the unixyness of macOS from most of its users and is successful at that. One of the many things I do not like about that company.
  Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)