nix/darwin/sketchybar/config/items/cal.lua
2025-04-08 23:41:12 -05:00

50 lines
1.3 KiB
Lua

local colors = require("colors")
local settings = require("settings")
-- Padding item required because of bracket
sbar.add("item", { position = "right", width = settings.group_paddings })
local cal = sbar.add("item", {
icon = {
color = colors.white,
padding_left = 0,
font = { size = 13 },
},
label = {
color = colors.white,
padding_right = 0,
align = "right",
},
position = "right",
update_freq = 30,
padding_left = 0,
padding_right = 0,
click_script = "open -n -a Calendar",
-- background = {
-- color = colors.bg1,
-- border_color = colors.bar.border,
-- border_width = 1,
-- },
})
-- Double border for calendar using a single item bracket
-- sbar.add("bracket", { cal.name }, {
-- background = {
-- color = colors.transparent,
-- height = 30,
-- border_color = colors.bar.bg,
-- },
-- })
-- Padding item required because of bracket
sbar.add("item", { position = "right", width = settings.group_paddings })
-- cal:subscribe({ "forced", "routine", "system_woke" }, function(env)
-- cal:set({ icon = os.date("􀉉 %B %d %a"), label = os.date("􀐫 %H:%M") })
-- end)
cal:subscribe({ "forced", "routine", "system_woke" }, function(env)
cal:set({
icon = os.date("􀉉 %B %d %a"),
label = os.date("􀐫 %I:%M %p"), -- 12-hour format with AM/PM
})
end)