Detect wireguard interfaces as tunnel type

This commit is contained in:
Pavle Portic 2019-04-14 00:46:40 +02:00
parent b4a66fd8be
commit 579239292b
No known key found for this signature in database
GPG key ID: 6758ACE46AA2A849

View file

@ -63,7 +63,7 @@ class Module(bumblebee.engine.Module):
return False
def _istunnel(self, intf):
return intf.startswith("tun")
return intf.startswith("tun") or intf.startswith("wg")
def get_addresses(self, intf):
retval = []
@ -74,7 +74,7 @@ class Module(bumblebee.engine.Module):
except Exception:
return []
return retval
def _update_widgets(self, widgets):
interfaces = [i for i in netifaces.interfaces() if not i.startswith(self._exclude)]
@ -90,7 +90,7 @@ class Module(bumblebee.engine.Module):
if len(self._states["exclude"]) > 0 and state in self._states["exclude"]: continue
if len(self._states["include"]) > 0 and state not in self._states["include"]: continue
widget = self.widget(intf)
if not widget:
widget = bumblebee.output.Widget(name=intf)
@ -104,7 +104,7 @@ class Module(bumblebee.engine.Module):
for widget in widgets:
if widget.get("visited") is False:
widgets.remove(widget)
def get_ssid(self, intf):
if self._iswlan(intf):
try: