adi1090x / widgets

Few widgets for Eww, Elkowar’s Wacky Widgets.
GNU General Public License v3.0
643 stars 41 forks source link

Weather not working (?) #4

Closed jonkke8 closed 3 years ago

jonkke8 commented 3 years ago

Basically, my weather widget is not working at all, even after trying to configure the script. I have no clue as to why it doesn't work.

Mohamed-Aziz-Ben-Nessir commented 3 years ago

did u switch from xml to yuck ?

jonkke8 commented 3 years ago

did u switch from xml to yuck ?

No, I just installed the older version of eww

Mohamed-Aziz-Ben-Nessir commented 3 years ago

Are u sure u have the right key and id ?

jonkke8 commented 3 years ago

Are u sure u have the right key and id ?

I'm sure I do

yongkyw commented 3 years ago

did u solve this problem?

jonkke8 commented 3 years ago

did u solve this problem?

Nope..

AfdolSD commented 3 years ago

Try to edit the weather_info script, see if it work.

change the weather var and remove echo ${weather} line.

## Get data
get_weather_data() {
    weather=$(curl -sf "http://api.openweathermap.org/data/2.5/weather?APPID="$KEY"&id="$ID"&units="$UNIT"")

         if [ ! -z "$weather" ]; then
        weather_temp=`echo "$weather" | jq ".main.temp" | cut -d "." -f 1`
                ...
}

change the execute, remove if [[ "$1" == "--getdata" ]]; then then start new if statement.

## Execute
    get_weather_data
if [[ "$1" == "--icon" ]]; then
    cat ${cache_weather_icon}
elif [[ "$1" == "--temp" ]]; then
    ...
fi
AfdolSD commented 3 years ago

Also, you need to remove "" in APIKEY and city Key

## Weather data
KEY="YOUR_KEY" --> KEY=123456789..
ID="YOUR_CITY_ID" --> ID=11234..
UNIT="metric"   # Available options : 'metric' or 'imperial'
AfdolSD commented 3 years ago

image It works fine for me.

yongkyw commented 3 years ago

thanks a lot, this solved my problem

jonkke8 commented 3 years ago

Solved for me as well, thanks!

littleblack111 commented 1 year ago

what is the exact script for open weather?