i3-companion: fix bluetooth on/off

This commit is contained in:
Vincent Bernat 2021-07-16 07:27:59 +02:00
parent fc3563777a
commit a5e5b23ec8

View file

@ -658,12 +658,12 @@ async def bluetooth_status(i3, event, *args):
major = (device_class & 0x1F00) >> 8
minor = (device_class & 0xFC) >> 2
devices.append((major, minor))
if not powered:
polybar("bluetooth", "")
return
# Generate output
# See: https://btprodspecificationrefs.blob.core.windows.net/assigned-numbers/Assigned%20Number%20Types/Baseband.pdf
if not powered:
output = ""
else:
output = [icons["bluetooth"]]
for major, minor in devices:
if major == 1: