Skip to content

weather block: add more icons #1097

Open
@ammgws

Description

@ammgws

Currently we only support clear, rain, clouds, thunderstorm and snow:

self.weather.set_icon(match raw_weather.as_str() {
"Clear" => "weather_sun",
"Rain" | "Drizzle" => "weather_rain",
"Clouds" | "Fog" | "Mist" => "weather_clouds",
"Thunderstorm" => "weather_thunder",
"Snow" => "weather_snow",
_ => "weather_default",
});

i3status-rust/src/icons.rs

Lines 148 to 153 in d39cd39

"weather_clouds" => " \u{f0c2} ", // fa-cloud
"weather_default" => " \u{f0c2} ", // fa-cloud
"weather_rain" => " \u{f043} ", // fa-tint
"weather_snow" => " \u{f2dc} ", // fa-snowflake-o
"weather_sun" => " \u{f185} ", // fa-sun-o
"weather_thunder" => " \u{f0e7} ", // fa-bolt

We are grabbing the weather state from the JSON weather.main field which has a limited set of states. If we instead grab the weather.id field then we have much more detail: https://openweathermap.org/weather-conditions

Meanwhile, Font Awesome has some icons we are not using yet, such as "clouds-shower-heavy", which we could then use if we made the change mentioned above: https://fontawesome.com/icons?d=gallery&p=2&c=weather&m=free

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions