50 lines
1.3 KiB
Lua
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.fg,
|
|
padding_left = 0,
|
|
font = { size = 13 },
|
|
},
|
|
label = {
|
|
color = colors.fg,
|
|
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)
|