Skip to content

Commit

Permalink
src/lua: scrolling on the audio widget changes volume
Browse files Browse the repository at this point in the history
  • Loading branch information
Daru-san committed Oct 31, 2024
1 parent ec265ba commit e127fc6
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions lua/bar/audio.lua
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,13 @@ return function()
tooltip_text = bind(speaker, "volume"):as(function(v)
return string.format("%.0f%%", v * 100)
end),
on_scroll = function(_, event)
if event.delta_y < -1 then
speaker.volume = speaker.volume + 0.05
elseif event.delta_y > -1 then
speaker.volume = speaker.volume - 0.05
end
end,
Widget.Box({
Widget.Revealer({
reveal_child = scroll_revealed(),
Expand Down

0 comments on commit e127fc6

Please sign in to comment.