1

I have a problem with a Conky widget that uses the api.openweathermap.org. The weather doesn't get displayed.

The image

I have changed the API key and the City ID in the: ~/.conky/Acubens/scripts/weather-v2.0.sh but it didn't fix it. Edited file:

#!/bin/bash

v2.0 Closebox73

This script is to get weather data from openweathermap.com in the form of a json file

so that conky will still display the weather when offline even though it doesn't up to date

Variables

get your city id at https://openweathermap.org/find and replace

city_id=588335

replace with yours

api_key=fa7e6905acd7201c439480bea7d20871

choose between metric for Celcius or imperial for fahrenheit

unit=celcius

I'm not sure it will support all language,

lang=en

Main command

url="api.openweathermap.org/data/2.5/weather?id=${city_id}&appid=${api_key}&cnt=5&units=${unit}&lang=${lang}" curl ${url} -s -o ~/.cache/weather.json

exit

I had also tried the fix from another post (chmod o+w ~/.cache/weather.json): How to display weather properly with conky?

And the command output result was No such file or directory

I am quite new to Ubuntu, and I don't know what I am supposed to do.

karel
  • 122,292
  • 133
  • 301
  • 332

1 Answers1

0

I had the same issue. Mjy fix was :

  1. Check the path in weather-v2.0.sh. The main command should be

    url="api.openweathermap.org/data/2.5/weather?id=${city_id}&appid=${api_key}&cnt=5&units=${unit}&lang=${lang}" curl ${url} -s -o ~/.cache/weather.json

  2. install jq. Sudo apt install jq

You might be able to bypass step 1 as I messed around with the scripts a bit and cant remember what the original was.

Hope this helps