From b3c386b77809084ff8b9026a3fb5a4f4957fff59 Mon Sep 17 00:00:00 2001 From: Vincent Bernat Date: Sun, 11 Jul 2021 22:51:30 +0200 Subject: [PATCH] i3-companion: rename network_manager_update The goal is only to display notifications. --- bin/i3-companion | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/bin/i3-companion b/bin/i3-companion index 81b0ec2..beaa222 100755 --- a/bin/i3-companion +++ b/bin/i3-companion @@ -383,10 +383,12 @@ async def output_update(i3, event): signature="uu", ) ) -async def network_manager_update(i3, event, path, state, reason): +async def network_manager_notifications(i3, event, path, state, reason): logger.debug("from %s state: %d, reason: %d", path, state, reason) NM_ACTIVE_CONNECTION_STATE_ACTIVATED = 2 if state not in {NM_ACTIVE_CONNECTION_STATE_ACTIVATED}: + # We cannot get proper state unless the connection is + # activated, unless we maintain state. return peer = i3.system_bus["org.freedesktop.NetworkManager"][path] try: @@ -465,6 +467,7 @@ async def main(options): ) async def wrapped(path, args): return await fn(i3, event, path, *args) + return wrapped bus.listen_signal(