Add Weather widget and integrate OpenWeatherMap API for dynamic updates

This commit is contained in:
2025-12-29 00:57:38 +01:00
parent e77e1d72b8
commit 57f7898d65
4 changed files with 424 additions and 0 deletions
+8
View File
@@ -35,6 +35,7 @@ func initWidgets(ctx context.Context, term *tcell.Terminal) {
widgets.New("Clock", widgets.Clock()),
widgets.New("Date", widgets.Date()),
widgets.New("Calendar", widgets.Calendar()),
widgets.New("Weather", widgets.Weather()),
widgets.New("ChangeTitle", widgets.TextInput(titleUpdate, textinput.Label("Update Title: "), textinput.PlaceHolder("New Title"))),
widgets.New("Wifi", widgets.WifiQRCode()),
widgets.New("NetworkDevices", widgets.NetworkDevices()),
@@ -104,6 +105,13 @@ func layout() []container.Option {
),
),
grid.ColWidthPerc(25,
grid.RowHeightFixed(20,
grid.Widget(widgets.Get["Weather"],
container.BorderTitle("Weather"),
container.Border(linestyle.Light),
container.BorderColor(cell.ColorWhite),
),
),
grid.RowHeightPerc(25,
grid.Widget(widgets.Get["empty"]),
),