From 1173df26fd78fdd59679645004847237ed7a0a54 Mon Sep 17 00:00:00 2001 From: Freya Murphy Date: Tue, 17 Jun 2025 15:14:45 -0400 Subject: add astal package, update flake to support packages --- pkgs/astal/src/widget/bar/date.lua | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 pkgs/astal/src/widget/bar/date.lua (limited to 'pkgs/astal/src/widget/bar/date.lua') diff --git a/pkgs/astal/src/widget/bar/date.lua b/pkgs/astal/src/widget/bar/date.lua new file mode 100644 index 0000000..b64d8bb --- /dev/null +++ b/pkgs/astal/src/widget/bar/date.lua @@ -0,0 +1,18 @@ +local astal = require("astal") +local Widget = require("astal.gtk3.widget") +local Variable = astal.Variable +local GLib = astal.require("GLib") + +local format = "%Y-%m-%d %a %H:%M:%S" +local date = Variable(""):poll( + 1000, function() + return GLib.DateTime.new_now_local():format(format) + end +); + +return function() + return Widget.Label({ + class_name = "date", + label = date(), + }) +end -- cgit v1.2.3-freya