mirror of
https://github.com/vincentbernat/i3wm-configuration.git
synced 2025-06-26 11:48:33 +02:00
xsecurelock: increase readibility on light backgronds
Yes, I have some of them. No outline.
This commit is contained in:
parent
76dfac0d99
commit
0ac37ce34d
1 changed files with 8 additions and 11 deletions
|
@ -68,16 +68,13 @@ def on_win_draw(widget, cctx, ctx):
|
||||||
|
|
||||||
def on_overlay_draw(widget, cctx, ctx):
|
def on_overlay_draw(widget, cctx, ctx):
|
||||||
"""Draw overlay (clock and weather)."""
|
"""Draw overlay (clock and weather)."""
|
||||||
# Clock
|
cctx.set_operator(cairo.OPERATOR_DIFFERENCE)
|
||||||
cctx.set_operator(cairo.OPERATOR_SOURCE)
|
|
||||||
wwidth, wheight = widget.get_parent().get_size()
|
wwidth, wheight = widget.get_parent().get_size()
|
||||||
|
|
||||||
|
# Clock
|
||||||
if ctx.clock:
|
if ctx.clock:
|
||||||
time, date = ctx.clock
|
time, date = ctx.clock
|
||||||
|
cctx.set_source_rgb(1, 1, 1)
|
||||||
def draw(what, outline):
|
|
||||||
cctx.move_to(*text_position)
|
|
||||||
cctx.set_source_rgb(1, 1, 1)
|
|
||||||
cctx.show_text(what)
|
|
||||||
|
|
||||||
# Time
|
# Time
|
||||||
cctx.select_font_face(
|
cctx.select_font_face(
|
||||||
|
@ -85,8 +82,8 @@ def on_overlay_draw(widget, cctx, ctx):
|
||||||
)
|
)
|
||||||
cctx.set_font_size(ctx.clock_font_size)
|
cctx.set_font_size(ctx.clock_font_size)
|
||||||
_, _, twidth, theight, _, _ = cctx.text_extents(re.sub(r"\d", "8", time))
|
_, _, twidth, theight, _, _ = cctx.text_extents(re.sub(r"\d", "8", time))
|
||||||
text_position = wwidth // 2 - twidth // 2, wheight // 3
|
cctx.move_to(wwidth // 2 - twidth // 2, wheight // 3)
|
||||||
draw(time, 2)
|
cctx.show_text(time)
|
||||||
|
|
||||||
# Date
|
# Date
|
||||||
cctx.select_font_face(
|
cctx.select_font_face(
|
||||||
|
@ -94,8 +91,8 @@ def on_overlay_draw(widget, cctx, ctx):
|
||||||
)
|
)
|
||||||
cctx.set_font_size(ctx.clock_font_size // 3)
|
cctx.set_font_size(ctx.clock_font_size // 3)
|
||||||
_, _, twidth, theight, _, _ = cctx.text_extents(date)
|
_, _, twidth, theight, _, _ = cctx.text_extents(date)
|
||||||
text_position = wwidth // 2 - twidth // 2, wheight // 3 + theight * 1.5
|
cctx.move_to(wwidth // 2 - twidth // 2, wheight // 3 + theight * 1.5)
|
||||||
draw(date, 2)
|
cctx.show_text(date)
|
||||||
|
|
||||||
# Weather
|
# Weather
|
||||||
# We can have polybar markups in it. We assume %{Tx} means to use
|
# We can have polybar markups in it. We assume %{Tx} means to use
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue