i3-companion: just wait more for bluetooth device change

This way, we wait enough to get battery level. Signal from PulseAudio
cannot be captured for some reason. UPower does not send a signal for
the new battery. And Bluez does not either.
This commit is contained in:
Vincent Bernat 2022-04-09 12:18:09 +02:00
parent 59382c1739
commit 29612a7851

View file

@ -743,18 +743,9 @@ async def bluetooth_notifications(i3, event, path, interface, changed, invalid):
and "Percentage" in args[1] and "Percentage" in args[1]
), ),
), ),
DBusSignal(
path="/org/pulseaudio",
interface="org.freedesktop.DBus.Properties",
member="PropertiesChanged",
signature="sa{sv}as",
onlyif=lambda args: (
args[0] == "org.bluez.BatteryProvider1" and "Percentage" in args[1]
),
),
) )
@retry(2) @retry(2)
@debounce(1) @debounce(4)
@polybar("bluetooth") @polybar("bluetooth")
async def bluetooth_status(i3, event, *args): async def bluetooth_status(i3, event, *args):
"""Update bluetooth status for Polybar.""" """Update bluetooth status for Polybar."""