mirror of
https://github.com/vincentbernat/i3wm-configuration.git
synced 2025-06-21 09:35:40 +02:00
i3-companion: fix bluetooth not powered case
This commit is contained in:
parent
ef60aa5f13
commit
1c61c22066
1 changed files with 25 additions and 26 deletions
|
@ -838,32 +838,31 @@ async def bluetooth_status(i3, event, *args):
|
||||||
devices.append(device)
|
devices.append(device)
|
||||||
|
|
||||||
if not powered:
|
if not powered:
|
||||||
output = ""
|
return ""
|
||||||
else:
|
output = ["bluetooth"]
|
||||||
output = ["bluetooth"]
|
for device in devices:
|
||||||
for device in devices:
|
bicons = {
|
||||||
bicons = {
|
"audio-card": "loudspeaker",
|
||||||
"audio-card": "loudspeaker",
|
"audio-headphones": "headphones",
|
||||||
"audio-headphones": "headphones",
|
"audio-headset": "headset",
|
||||||
"audio-headset": "headset",
|
"camera-photo": "camera",
|
||||||
"camera-photo": "camera",
|
"camera-video": "webcam",
|
||||||
"camera-video": "webcam",
|
"computer": "laptop",
|
||||||
"computer": "laptop",
|
"input-gaming": "gamepad",
|
||||||
"input-gaming": "gamepad",
|
"input-keyboard": "keyboard",
|
||||||
"input-keyboard": "keyboard",
|
"input-mouse": "mouse",
|
||||||
"input-mouse": "mouse",
|
"network-wireless": "access-point",
|
||||||
"network-wireless": "access-point",
|
"phone": "phone",
|
||||||
"phone": "phone",
|
"printer": "printer",
|
||||||
"printer": "printer",
|
"scanner": "scanner",
|
||||||
"scanner": "scanner",
|
}
|
||||||
}
|
output.append(bicons.get(device.icon, "unknown"))
|
||||||
output.append(bicons.get(device.icon, "unknown"))
|
if device.battery is not None:
|
||||||
if device.battery is not None:
|
output[-1] = (output[-1], f"battery-{(device.battery+12)//25*25}")
|
||||||
output[-1] = (output[-1], f"battery-{(device.battery+12)//25*25}")
|
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
|
)
|
||||||
)
|
|
||||||
|
|
||||||
|
|
||||||
@on(
|
@on(
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue