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

18
lua/widgets/bar/clock.lua Normal file
View File

@ -0,0 +1,18 @@
local datetime = Variable(0):poll(1000, "date +'%d %b %H:%M:%S'", function(out, _) return out end)
local unix_seconds = Variable(0):poll(1000, "date +'%s'", function(out, _) return out end)
return Widget.Box({
class_name = 'clock',
vertical = true,
valign = 'CENTER',
children = {
Widget.Label({
halign = 'START',
label = bind(datetime, 'value')
}),
Widget.Label({
halign = 'START',
label = bind(unix_seconds, 'value')
})
}
})