From 80c7af79db71aa9093e2f7aecf34cc799371ce24 Mon Sep 17 00:00:00 2001 From: S4NKALP Date: Sat, 18 Jul 2026 14:12:56 +0545 Subject: [PATCH] fix(network): add missing get_connectivity() call and widen NM import guard - get_connectivity was compared as method object (always True), wired icon always showed no-route when activated - NM import now catches GLib.Error and ImportError, not just ValueError - Sets NM = None on failure instead of leaving undefined --- src/services/network.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/services/network.py b/src/services/network.py index 54e3377..6f87c36 100644 --- a/src/services/network.py +++ b/src/services/network.py @@ -4,13 +4,14 @@ from typing import List, Literal import gi from fabric.core.service import Property, Service, Signal -from fabric.utils import Gio, bulk_connect, exec_shell_command_async, logger +from fabric.utils import Gio, GLib, bulk_connect, exec_shell_command_async, logger try: gi.require_version("NM", "1.0") from gi.repository import NM -except ValueError: - logger.error("Failed to start network manager") +except (ValueError, GLib.Error, ImportError) as e: + logger.error(f"Failed to start network manager: {e}") + NM = None class Wifi(Service): @@ -258,7 +259,7 @@ class Ethernet(Service): elif network == "activating": return "network-wired-acquiring-symbolic" - elif self._device.get_connectivity != NM.ConnectivityState.FULL: + elif self._device.get_connectivity() != NM.ConnectivityState.FULL: return "network-wired-no-route-symbolic" return "network-wired-disconnected-symbolic"