awesome-wm-widgets
awesome-wm-widgets copied to clipboard
[weather] Icon not shown in bar
Hello,
I have this code to create a bar at the bottom using some widgets:
bottombar = awful.wibar({ position = "bottom" })
bottombar.widget = {
layout = wibox.layout.align.horizontal,
{
layout = wibox.layout.fixed.horizontal,
spacing_widget = wibox.widget.separator,
spacing = 10,
cpu_widget({ width=100 }),
ram_widget(),
},
{
layout = wibox.layout.fixed.horizontal,
wibox.widget.textbox("Some text")
},
{
layout = wibox.layout.fixed.horizontal,
wibox.widget.textbox("Some 2 text"),
weather_widget({
api_key = "mykey",
coordinates = {lat, lon},
show_hourly_forecast = true,
show_daily_forecast = true}),
wibox.widget.textbox("Some 3 text")
}
}
this works mostly fine, as you can see in the attached screenshot:
.
The CPU and memory are there, then there is "Some text". On the very right side of the bar, there is "Some 2 text" and "Some 3 text". If I click between them, the weather widgets pops up, including icons and everything. However, there is no icon shown in the bar.
awesome v4.3-1037-g149d18e0 (Too long)
• Compiled against Lua 5.3.3 (running with Lua 5.3)
• API level: 4
• D-Bus support: yes
• xcb-errors support: no
• execinfo support: yes
• xcb-randr version: 1.6
• LGI version: 0.9.2
• Transparency enabled: yes
• Custom search paths: no
What can be the problem here?
Thanks!
~Ok, that went away after I added the https://github.com/streetturtle/awesome-buttons repository to my configuration directory.~
Edit: Thought that it was fixed, but the icon still does not appear.
same problem here.
volume_widget{ widget_type = 'icon' },
weather_widget({ api_key='<myapik', coordinates = {45.5017, -73.5673}, }),
mytextclock,
So I see the volume and my clock, but weather is empty. No icons nothing. Generated apikey from openweathermap so it should work but not sure how to debug.
@thepenguinthatwants What version of awesome you use? Something compiled from git master, like me?
I am using https://archlinux.org/packages/community/x86_64/awesome/ awesome 4.3-2
It might be a missing icon. Have you ever seen a weather-widget icon? Do you have anything in logs?
Home many screens do you have?
weather-widget icon is in the folder of weather-widget weather-widget/icons/weather-underground-icons. But I have never seeing them on my wibar.
I have two screens
I think the problem is the fact OpenWeatherMap disabled an ability for new free accounts to use onecall
. For example, if I send a request to https://api.openweathermap.org/data/2.5/onecall?lat=45.5&lon=-73.57&appid=NEW_FREE_API&units=metric&exclude=minutely
I'll get the error
{"cod":401, "message": "Invalid API key. Please see https://openweathermap.org/faq#error401 for more info."}
The same request for weather
works fine - https://api.openweathermap.org/data/2.5/weather?lat=45.5&lon=-73.57&appid=NEW_FREE_API&units=metric&exclude=minutely
{"coord":{"lon":-73.57,"lat":45.5},"weather":[{"id":601,"main":"Snow","description":"snow","icon":"13d"}],"base":"stations","main":{"temp":-6.63,"feels_like":-13.63,"temp_min":-7.65,"temp_max":-4.21,"pressure":1007,"humidity":89},"visibility":4828,"wind":{"speed":6.69,"deg":20},"snow":{"1h":0.51},"clouds":{"all":100},"dt":1704661101,"sys":{"type":1,"id":498,"country":"CA","sunrise":1704630829,"sunset":1704662789},"timezone":-18000,"id":6077243,"name":"Montreal","cod":200}
But the problem is the fact the data structure is different. The issue is also discussed here - https://github.com/domoticz/domoticz/issues/5336#issuecomment-1243023845
Seems like old accounts are not affected by these API changes, so it explains why not all people have the issue