summaryrefslogtreecommitdiff
path: root/pkgs/astal/src/widget/bar/date.lua
blob: 7afa20e12134a839b8331ca2bd7387314dcb2606 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
local astal = require("astal")
local Widget = require("astal.gtk3.widget")
local Variable = astal.Variable
local lib = require("lib")

local date = Variable(""):poll(
	1000, function()
		return lib.time({ format = "%Y-%m-%d %a %H:%M:%S" })
	end
);

return function()
	return Widget.Label({
		class_name = "date",
		label = date(),
	})
end