From f439a62b1c45035e583c14fbd807efd6b6dd871f Mon Sep 17 00:00:00 2001 From: Vincent Bernat Date: Mon, 28 Mar 2022 11:42:34 +0200 Subject: [PATCH] i3-companion: schedule bluetooth battery update even on failures --- bin/i3-companion | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/bin/i3-companion b/bin/i3-companion index e56d378..818584c 100755 --- a/bin/i3-companion +++ b/bin/i3-companion @@ -861,13 +861,13 @@ async def bluetooth_status(i3, event, *args): # Choose an icon icon = f"battery-{(battery+12)//25*25}" output[-1] = (output[-1], icon) - # Schedule a refresh in 5 minutes - bluetooth_status.scheduled = loop.call_later( - 600, - lambda: asyncio.create_task(bluetooth_status(i3, StartEvent)), - ) except Exception as exc: logger.info("cannot get battery status: %s", exc) + # Schedule a refresh in 5 minutes + bluetooth_status.scheduled = loop.call_later( + 600, + lambda: asyncio.create_task(bluetooth_status(i3, StartEvent)), + ) return "|".join( (" ".join(icons[oo] for oo in o) if type(o) is tuple else icons[o]) for o in output