mirror of
https://github.com/vincentbernat/i3wm-configuration.git
synced 2025-07-03 14:54:21 +02:00
i3-companion: let @retry decorator handle exception for battery
This commit is contained in:
parent
f439a62b1c
commit
fcd75c38b4
1 changed files with 26 additions and 28 deletions
|
@ -834,7 +834,6 @@ async def bluetooth_status(i3, event, *args):
|
||||||
# from PA 16, it may be exposed by PA, then to BlueZ.
|
# from PA 16, it may be exposed by PA, then to BlueZ.
|
||||||
# See
|
# See
|
||||||
# https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/merge_requests/482
|
# https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/merge_requests/482
|
||||||
try:
|
|
||||||
loop = asyncio.get_event_loop()
|
loop = asyncio.get_event_loop()
|
||||||
sock = socket.socket(
|
sock = socket.socket(
|
||||||
socket.AF_BLUETOOTH, socket.SOCK_STREAM, socket.BTPROTO_RFCOMM
|
socket.AF_BLUETOOTH, socket.SOCK_STREAM, socket.BTPROTO_RFCOMM
|
||||||
|
@ -861,8 +860,7 @@ 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)
|
||||||
except Exception as exc:
|
|
||||||
logger.info("cannot get battery status: %s", exc)
|
|
||||||
# Schedule a refresh in 5 minutes
|
# Schedule a refresh in 5 minutes
|
||||||
bluetooth_status.scheduled = loop.call_later(
|
bluetooth_status.scheduled = loop.call_later(
|
||||||
600,
|
600,
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue