mirror of
https://github.com/vincentbernat/i3wm-configuration.git
synced 2025-06-25 19:28:34 +02:00
i3-companion: schedule bluetooth battery update even on failures
This commit is contained in:
parent
0ed90e0f85
commit
f439a62b1c
1 changed files with 5 additions and 5 deletions
|
@ -861,13 +861,13 @@ async def bluetooth_status(i3, event, *args):
|
||||||
# Choose an icon
|
# Choose an icon
|
||||||
icon = f"battery-{(battery+12)//25*25}"
|
icon = f"battery-{(battery+12)//25*25}"
|
||||||
output[-1] = (output[-1], icon)
|
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:
|
except Exception as exc:
|
||||||
logger.info("cannot get battery status: %s", 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(
|
return "|".join(
|
||||||
(" ".join(icons[oo] for oo in o) if type(o) is tuple else icons[o])
|
(" ".join(icons[oo] for oo in o) if type(o) is tuple else icons[o])
|
||||||
for o in output
|
for o in output
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue