From a8da83fd1e6b253b7b48d28306ab562db606108b Mon Sep 17 00:00:00 2001 From: tobi-wan-kenobi Date: Wed, 18 Dec 2024 19:03:57 +0100 Subject: [PATCH] fix(modules/nic): handle missing wireless strength info gracefully if unable to read wireless signal strength -> show an error fixes #1029 --- bumblebee_status/modules/core/nic.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/bumblebee_status/modules/core/nic.py b/bumblebee_status/modules/core/nic.py index cb83fcd5..2b4958d8 100644 --- a/bumblebee_status/modules/core/nic.py +++ b/bumblebee_status/modules/core/nic.py @@ -22,6 +22,7 @@ import shutil import netifaces import subprocess +import os import core.module import core.decorators @@ -177,6 +178,8 @@ def get_ssid(self, intf): def get_strength_dbm(self, intf): if not self._iswlan(intf) or self._istunnel(intf) or not self.iw: return None + if not os.path.isfile("/proc/net/wireless"): + return None with open("/proc/net/wireless", "r") as file: for line in file: