zagortenay333 / conky_themes

A small collection of conky configs
624 stars 93 forks source link

Metric system uses Kelvin temperatures #38

Closed Michael-A-D closed 7 years ago

Michael-A-D commented 7 years ago

I used the preview script (./preview.sh) to configure Harmattan and chose metric system as my unit system. Unfortunately temperatures were displayed in Kelvin, while Celsius is what we're used to. Sadly it seems that openweathermap API only gives these two choices: imperial (°F) and metric (°K). So I edited my .conkyrc to get what I need (0°C is 273.15°K):

${color2}${voffset 51}${alignc 77}${execi 300 jq -r .list[0].temp.min ~/.cache/forecast.json | awk '{print int($1-273.15)}' # round num}°/${execi 300 jq -r .list[0].temp.max ~/.cache/forecast.json | awk '{print int($1-273.15)}' # round num}°${color}

I do not understand what the +0.5 was intended to do in the original version.

Either I missed something in my configuration, or you might want to include that fix for the Celsius people around Here.

zagortenay333 commented 7 years ago

Actually that's a bug in the preview script. Openweathermap allows celcius, kelvin and fahrenheit. https://openweathermap.org/current#data

Will fix.

zagortenay333 commented 7 years ago

Should be fixed with bf96f0d27981e0abcb6a43c555bbde62e81e4bfc

Michael-A-D commented 7 years ago

Fixed indeed, I misunderstood OWM's API, Kelvin is default, Celsius is metric and Fahrenheit is imperial. Thanks for the fix!