OpenWeatherMap weather colors on i3-blocks

Hi everyone!

I just got OpenWeatherMap to work on i3-blocks and have been really digging it. I don’t know if this is possible, but is there a way to make it so the little weather icons have color? Say, when it’s sunny, a little sun icon appears. I want this sun icon to be orange, unlike the rest of the text which is, say, white. Where would it be a good place to start?

Thanks in advance!

Edit: I forgot to mention! Not every icon would have the same color. When it’s rainy, the little water droplet would be blue. :smile:

possible by setting the color inside the scripts:

I am not sure how exactly… but may someone knows?

1 Like

I see! the openweather script (as opposed to the openweather-city script) has an option for setting the color of the output. However, I’d like this color to apply to the little icon only, not the entire text. Thanks for the help though, that’s an important first step!

it must be possible… as the i3-bar simply show command output… so you only need to find the code that set colors as you like…

I managed to customize the color output depending on the weather. Simply determine which color you’d like it to be in the openweather script like so:

case $WEATHER_CONDITION in
  'Clouds')
    if [ "$DAYTIME" == "d" ]; then
        WEATHER_ICON=""
        WEATHER_COLOR="#00ffff"
    else
        WEATHER_ICON=""
        WEATHER_COLOR="#00cccc"
    fi
    ;;
  'Rain')
    WEATHER_ICON=""
    WEATHER_COLOR="#0066ff"
    ;;
#keeps going...

In this case, cloudy would be a light blue, rainy would be deep blue… And so on for the rest of weather conditions. I hope somebody is able to find this helpful.

However, now the problem is that all the text is colored:
image
And I only want the icon (e.g. the cloud in the image) to be colored, with the rest of the text being white.

1 Like
WEATHER_ICON_COLOR=

would be a nice option… as the iconicfont icons are only text … it does not do that…