bjesus / wttrbar

Custom module for showing the weather in Waybar, using the great wttr.in
MIT License
164 stars 26 forks source link

Change Icons via flag #50

Closed dianaw353 closed 4 months ago

dianaw353 commented 7 months ago

Hello again! I have rewritten the implementation for adding icon-family to wttrbar for atleast the third time now. This time I believe its by best implementation to change the icons. This includes blueprint to add icon family as simple as possible. To be able to add your own icons it requires you to add four parts which are:

constants.rs
pub const WEATHER_CODES_NERD: &[(i32, &str)] = &[
// Add list of icons
]:

SUNRISE_SUNSET_ICONS
("name of icons", ("your icon", "your icon")

MIN_MAX_TEMP_ICONS
("name of icons", ("your icon", "your icon")

constants.rs
get_weather_codes
"name of icons" => WEATHER_CODES_(name of icons),

To be able to change the icon familly just add the following to the wttrbar command: --icon-family "noto", --icon-family "nerd"

ps. opps the commit message is wrong as i should say icon-family instead

dianaw353 commented 6 months ago

The last few commits ive done is just making it more simple to add your own icons and adds error handing for the new flag so that if the user types in something incorrectly it displays a error instead of crashing the entire application.

bjesus commented 4 months ago

closing the PR for now as it doesn't seem active