Package: powerline-owmweather
powerline-owmweather 🌦A light-heartedPowerlinesegment for fetching and showing the weather in the current location (either by IP geolocation or by setting a location, seeConfigurationbelow).Keep in mind that powerline_owmweather is in early, rapid development stage so its API/configuration format may change.MotivationRequirementsInstallationActiviationConfiguration and CustomizationChangelogTODOMotivationThe built-in weather segment is using Yahoo Weather API which is no longer available so I decided to create an almost drop-in replacement usingOpenWeather.RequirementsPowerlineA (free)OpenWeatheraccount and API key with the "Current Weather Data" plan enabled.Installationpip install powerline-owmweatherActiviationThe very minimum required to activate the segment is to add the following to your theme JSON:{
   "function": "powerline_owmweather.weather",
   "args": {
       "openweathermap_api_key": API_KEY
   }
}and the following to your colorscheme JSON (the colors can be customized):"groups": {
      ...,
      "owmweather": {
          "fg": "gray9",
          "bg": "gray2",
          "attrs": []
    }
}Configuration and CustomizationThe following optionalargsare available:ArgumentTypeDescriptionDefaultpost_conditionstringString to append aftercondition""post_humiditystringString to append afterhumidity""post_locationstringString to append afterlocation""post_tempstringString to append aftertemp""pre_conditionstringString to prepend beforecondition" "pre_humiditystringString to prepend beforehumidity" "pre_locationstringString to prepend beforelocation" "pre_tempstringString to prepend beforetemp" "condition_as_iconbooleanIftrue, condition will be displayed as an icon (if one of known conditions).Iffalsecondition will be displayed as a stringtruehumidity_formatstringA Python format string that acceptshumidityas an argument"{humidity:.0f}"location_querystringLocation in format CITY, 2-LETTERS-COUNTRY-CODERetrived using IP geolocationshowstringComma-separated string specifies what data to show.Can include"condition","humidity","location","temp".SeeHighlight Groups"temp"temp_formatstringA Python format string that acceptstempas an argument"{temp:.0f}"ttl_in_minutesintegerTime in minutes for which location and weather are cached.Warning: The lower the value the slower your terminal will be60unitsstringTemperature units.Should be one of"C","F","K""C"Highlight GroupsEvery data in"show"is displayed in its own segment with its own highlight group, meaning it can be styled independently in your colorscheme JSON. Each highlight group is composed ofowmweather_{data_name}, for example:"owmweather_condition": {
    "fg": "gray6",
    "bg": "gray3",
    "attrs": []
},
"owmweather_temp": {
    "fg": "gray9",
    "bg": "gray2",
    "attrs": []
}"pre_{data_name}"and"post_{data_name}"can also be customized using"owmweather_pre_{data_name}"and"owmweather_post_{data_name}"highlight groups.If a specific highlight group is not defined then the style of"owmweather"group will be used.Changelog0.4 - Nov. 3 2020'%' is no longer in the default humidity_formatAdded pre_data and post_data arguments and highlight groupsAdded ability to show location0.3 - Nov. 1 2020Added ability to display humidity0.2 - Nov. 1 2020Added ability to display temperature, conditionAdded ability to display condition as either icons or strings0.1.1 - Oct. 31 2020Fixed a bug that prevented setting a customttl_in_minutesAdded debug logs0.1.0 - Oct. 31 2020Initial releaseTODOSupport iconsSupport weather description ("cloudy", "windy", etc)Support configurable information to display:TemperatureConditionWind speed/directionHumidityPressure