mirror of
https://github.com/elenapan/dotfiles.git
synced 2026-05-11 17:35:57 +08:00
Set textclock markup directly instead of through update functions
This commit is contained in:
parent
4493396bc7
commit
57e1087787
2 changed files with 4 additions and 26 deletions
|
|
@ -142,14 +142,10 @@ local hours = wibox.widget.textclock("%H ")
|
|||
hours.font = "sans bold 30"
|
||||
hours.align = "center"
|
||||
hours.valign = "center"
|
||||
local minutes = wibox.widget.textclock(" %M")
|
||||
local minutes = wibox.widget.textclock("<span foreground='" .. x.color14 .."'> %M</span>")
|
||||
minutes.font = "sans 30"
|
||||
minutes.align = "center"
|
||||
minutes.valign = "center"
|
||||
minutes.markup = "<span foreground='" .. x.color14 .."'>" .. minutes.text .. "</span>"
|
||||
minutes:connect_signal("widget::redraw_needed", function ()
|
||||
minutes.markup = "<span foreground='" .. x.color14 .."'>" .. minutes.text .. "</span>"
|
||||
end)
|
||||
|
||||
-- Time
|
||||
local time = wibox.widget {
|
||||
|
|
@ -167,23 +163,13 @@ day_of_the_week.align = "center"
|
|||
day_of_the_week.valign = "center"
|
||||
day_of_the_week.align = "center"
|
||||
day_of_the_week.valign = "center"
|
||||
-- day_of_the_week.markup = "<span foreground='" .. x.color7 .."'>" .. day_of_the_week.text .. "</span>"
|
||||
-- day_of_the_week:connect_signal("widget::redraw_needed", function ()
|
||||
-- day_of_the_week.markup = "<span foreground='" .. x.color7 .."'>" .. day_of_the_week.text .. "</span>"
|
||||
-- end)
|
||||
local day_of_the_month = wibox.widget.textclock("%d")
|
||||
|
||||
local day_of_the_month = wibox.widget.textclock("<span foreground='" .. x.color1 .."'>%d</span>")
|
||||
day_of_the_month.font = "sans bold 30"
|
||||
day_of_the_month.fg = x.color0
|
||||
day_of_the_month.align = "center"
|
||||
day_of_the_month.valign = "center"
|
||||
|
||||
day_of_the_month.align = "center"
|
||||
day_of_the_month.valign = "center"
|
||||
day_of_the_month.markup = "<span foreground='" .. x.color1 .."'>" .. day_of_the_month.text .. "</span>"
|
||||
day_of_the_month:connect_signal("widget::redraw_needed", function ()
|
||||
day_of_the_month.markup = "<span foreground='" .. x.color1 .."'>" .. day_of_the_month.text .. "</span>"
|
||||
end)
|
||||
|
||||
local date = wibox.widget {
|
||||
day_of_the_week,
|
||||
day_of_the_month,
|
||||
|
|
|
|||
|
|
@ -62,17 +62,9 @@ local day_of_the_week = wibox.widget {
|
|||
forced_width = dpi(1000),
|
||||
align = "center",
|
||||
valign = "center",
|
||||
widget = wibox.widget.textclock("%A")
|
||||
widget = wibox.widget.textclock(helpers.colorize_text("%A", x.color3))
|
||||
}
|
||||
|
||||
local function update_dotw()
|
||||
day_of_the_week.markup = helpers.colorize_text(day_of_the_week.text, x.color3)
|
||||
end
|
||||
update_dotw()
|
||||
day_of_the_week:connect_signal("widget::redraw_needed", function ()
|
||||
update_dotw()
|
||||
end)
|
||||
|
||||
local month = wibox.widget {
|
||||
font = "San Francisco Display Heavy 100",
|
||||
align = "center",
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue