xsecurelock: only display weather on first screen

This commit is contained in:
Vincent Bernat 2021-12-31 22:16:18 +01:00
parent bbf685ac76
commit 64f41c4825

View file

@ -106,7 +106,7 @@ def on_overlay_draw(widget, cctx, ctx):
# We can have polybar markups in it. We assume %{Tx} means to use
# Font Awesome 6 and we ignore font color change. The parsing is
# quite basic.
if ctx.weather:
if ctx.weather and ctx.position == (0, 0):
data = re.sub(r"%{F[#\d+-]+?}", "", ctx.weather)
data = re.split(r"(%{T[1-9-]})", data)
font = ctx.font_family
@ -184,7 +184,7 @@ if __name__ == "__main__":
ctx.background = None
ctx.weather = None
ctx.clock = None
ctx.position = [0, 0]
ctx.position = (0, 0)
ctx.window = Gtk.Window()
ctx.window.set_app_paintable(True)