add new widgets; rewrite workspace indicator

This commit is contained in:
gnat
2024-11-17 16:27:41 -08:00
parent 784e71e643
commit d584d25194
5 changed files with 125 additions and 10 deletions

View File

@ -0,0 +1,26 @@
local wp <const> = lgi.require("AstalWp").get_default()
local endpoint = wp:get_audio():get_default_speaker()
return Widget.Box({
class_name = 'volume-slider',
children = {
Widget.Button({
child = Widget.Icon({
icon = bind(endpoint, "volume-icon"),
}),
on_clicked = function()
endpoint:set_mute(not endpoint:get_mute())
end
}),
Widget.Slider({
class_name = 'volume-slider',
hexpand = true,
draw_value = false,
value = bind(endpoint, 'volume'),
on_value_changed = function(self)
endpoint:set_volume(self.value)
end
})
}
})