2024-02-19 19:41:33 -08:00
|
|
|
local gears = require("gears")
|
|
|
|
local wibox = require("wibox")
|
2024-02-24 14:01:36 -08:00
|
|
|
local helpers = require("helpers")
|
|
|
|
local beautiful = require("beautiful")
|
|
|
|
local config = require("config")
|
2024-02-19 19:41:33 -08:00
|
|
|
|
2024-02-24 14:01:36 -08:00
|
|
|
local theme = beautiful.get()
|
|
|
|
local dpi = beautiful.xresources.apply_dpi
|
|
|
|
|
|
|
|
local icon = helpers.ui.create_icon(config.icons.cal, theme.xcolor5)
|
2024-02-18 14:31:14 -08:00
|
|
|
|
|
|
|
local date = wibox.widget.textbox()
|
2024-02-24 14:01:36 -08:00
|
|
|
date.font = helpers.ui.set_font("11")
|
|
|
|
|
2024-02-19 19:41:33 -08:00
|
|
|
gears.timer({
|
2024-02-18 14:31:14 -08:00
|
|
|
timeout = 60,
|
|
|
|
autostart = true,
|
|
|
|
call_now = true,
|
|
|
|
callback = function()
|
2024-02-24 14:01:36 -08:00
|
|
|
date.markup = os.date(config.widget.date.format)
|
2024-02-19 19:41:33 -08:00
|
|
|
end,
|
|
|
|
})
|
2024-02-18 14:31:14 -08:00
|
|
|
|
2024-02-24 14:01:36 -08:00
|
|
|
return wibox.widget({
|
|
|
|
{
|
|
|
|
icon,
|
|
|
|
date,
|
|
|
|
spacing = dpi(8),
|
|
|
|
layout = wibox.layout.fixed.horizontal,
|
|
|
|
},
|
|
|
|
left = dpi(1),
|
|
|
|
right = dpi(1),
|
|
|
|
layout = wibox.container.margin,
|
|
|
|
})
|