mirror of
https://github.com/vincentbernat/i3wm-configuration.git
synced 2025-08-03 17:54:31 +02:00
xsecurelock: check clock more often
timeout_add is using a monotonic clock and therefore, we need to check for updates more often.
This commit is contained in:
parent
2447dcb575
commit
505786cefe
1 changed files with 5 additions and 3 deletions
|
@ -129,9 +129,11 @@ def on_background_change(monitor, f1, f2, event, ctx):
|
||||||
|
|
||||||
def on_clock_change(ctx):
|
def on_clock_change(ctx):
|
||||||
now = datetime.datetime.now()
|
now = datetime.datetime.now()
|
||||||
ctx.clock = now.strftime("%H:%M")
|
new_clock = now.strftime("%H:%M")
|
||||||
ctx.overlay.queue_draw()
|
if new_clock != ctx.clock:
|
||||||
GLib.timeout_add((60 - now.second) * 1000, on_clock_change, ctx)
|
ctx.clock = new_clock
|
||||||
|
ctx.overlay.queue_draw()
|
||||||
|
GLib.timeout_add(min(60 - now.second, 3) * 1000, on_clock_change, ctx)
|
||||||
|
|
||||||
|
|
||||||
def on_weather_change(monitor, f1, f2, event, ctx):
|
def on_weather_change(monitor, f1, f2, event, ctx):
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue