Skip to content

Commit

Permalink
feat: add preview on hover
Browse files Browse the repository at this point in the history
This was a nice contribution!

Co-authored-by: trap000d

Signed-off-by: André Jaenisch <andre.jaenisch@posteo.de>
  • Loading branch information
Ryuno-Ki committed Oct 22, 2024
1 parent f5e81de commit 8725950
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions weather-api-widget/weather.lua
Original file line number Diff line number Diff line change
Expand Up @@ -619,6 +619,18 @@ local function worker(user_args)
end
end)))

weather_widget:connect_signal("mouse::enter", function()
weather_widget:set_bg(beautiful.bg_focus)
weather_popup:move_next_to(mouse.current_widget_geometry)
end)

weather_widget:connect_signal("mouse::leave", function()
if weather_popup.visible then
weather_widget:set_bg('#00000000')
weather_popup.visible = not weather_popup.visible
end
end)

watch(
string.format(GET_FORECAST_CMD, weather_api),
timeout, -- API limit is 1k req/day; day has 1440 min; every 2 min is good
Expand Down

0 comments on commit 8725950

Please sign in to comment.