local icons = require("icons") local colors = require("colors").sections.calendar local settings = require("settings") local cal = sbar.add("item", { label = { padding_left = 6, padding_right = 12, font = { -- family = settings.font.numbers, style = settings.font.style_map["Bold"], }, }, -- label = { -- color = colors.label, -- align = "left", -- padding_right = 8, -- }, padding_left = 10, position = "right", update_freq = 30, click_script = "open -a 'Calendar'", }) cal:subscribe("mouse.clicked", function() sbar.animate("tanh", 8, function() cal:set { background = { shadow = { distance = 0, }, }, y_offset = -4, padding_left = 14, padding_right = 0, } cal:set { background = { shadow = { distance = 4, }, }, y_offset = 0, padding_left = 10, padding_right = 4, } end) end) cal:subscribe({ "forced", "routine", "system_woke" }, function() ---@diagnostic disable-next-line: param-type-mismatch cal:set { label = os.date("%I"):gsub("^0+", "") .. ":" .. os.date "%M %p" } end)