diff options
author | Freya Murphy <freya@freyacat.org> | 2025-06-19 12:40:01 -0400 |
---|---|---|
committer | Freya Murphy <freya@freyacat.org> | 2025-06-19 12:40:01 -0400 |
commit | 4b0fbc1feebfde058f2af2048fbb91ac15e6783f (patch) | |
tree | 26949163463859992429636d9200285c914a1d84 /pkgs/astal/src/widget | |
parent | tlp (diff) | |
download | dotfiles-nix-4b0fbc1feebfde058f2af2048fbb91ac15e6783f.tar.gz dotfiles-nix-4b0fbc1feebfde058f2af2048fbb91ac15e6783f.tar.bz2 dotfiles-nix-4b0fbc1feebfde058f2af2048fbb91ac15e6783f.zip |
refactor time function in astal lib
Diffstat (limited to 'pkgs/astal/src/widget')
-rw-r--r-- | pkgs/astal/src/widget/bar/date.lua | 5 | ||||
-rw-r--r-- | pkgs/astal/src/widget/deck/notifications.lua | 2 |
2 files changed, 3 insertions, 4 deletions
diff --git a/pkgs/astal/src/widget/bar/date.lua b/pkgs/astal/src/widget/bar/date.lua index b64d8bb..7afa20e 100644 --- a/pkgs/astal/src/widget/bar/date.lua +++ b/pkgs/astal/src/widget/bar/date.lua @@ -1,12 +1,11 @@ local astal = require("astal") local Widget = require("astal.gtk3.widget") local Variable = astal.Variable -local GLib = astal.require("GLib") +local lib = require("lib") -local format = "%Y-%m-%d %a %H:%M:%S" local date = Variable(""):poll( 1000, function() - return GLib.DateTime.new_now_local():format(format) + return lib.time({ format = "%Y-%m-%d %a %H:%M:%S" }) end ); diff --git a/pkgs/astal/src/widget/deck/notifications.lua b/pkgs/astal/src/widget/deck/notifications.lua index e40a815..63740ab 100644 --- a/pkgs/astal/src/widget/deck/notifications.lua +++ b/pkgs/astal/src/widget/deck/notifications.lua @@ -53,7 +53,7 @@ function Header(notif) class_name = "time", hexpand = true, halign = "END", - label = lib.time(notif.time), + label = lib.time({ time = notif.time }), }), Widget.Button({ on_clicked = function() delete(notif.id) end, |