i3-companion: also listen to new interfaces to get battery status

This commit is contained in:
Vincent Bernat 2024-07-05 20:29:19 +02:00
parent 4ef90a4534
commit 8fa546d4a5

View file

@ -790,9 +790,16 @@ async def bluetooth_notifications(i3, event, path, interface, changed, invalid):
and "Percentage" in args[1] and "Percentage" in args[1]
), ),
), ),
DBusSignal(
path="/org/bluez",
interface="org.freedesktop.DBus.ObjectManager",
member="InterfacesAdded",
signature="oa{sa{sv}}",
onlyif=lambda args: ("org.bluez.Battery1" in args[1]),
),
) )
@retry(2) @retry(2)
@debounce(4) @debounce(1)
@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."""