From d57bbc28fec2f665642aa0d23464394c11350c84 Mon Sep 17 00:00:00 2001 From: tobi-wan-kenobi Date: Fri, 10 Apr 2020 16:45:45 +0200 Subject: [PATCH] [modules/vpn] Add experimental wireguard support fixes #595 --- bumblebee/modules/vpn.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/bumblebee/modules/vpn.py b/bumblebee/modules/vpn.py index b1dd0cf..78a28d2 100644 --- a/bumblebee/modules/vpn.py +++ b/bumblebee/modules/vpn.py @@ -38,7 +38,7 @@ class Module(bumblebee.engine.Module): for line in lines: info = line.split(':') try: - if info[1] == "vpn": + if self._isvpn(info[1]): self._vpn_profiles.append(info[0]) except: pass @@ -46,6 +46,9 @@ class Module(bumblebee.engine.Module): engine.input.register_callback(self, button=bumblebee.input.LEFT_MOUSE, cmd=self.popup) + def _isvpn(self, connection_type): + return connection_type in ["vpn", "wireguard"] + def update(self, widgets): try: res = bumblebee.util.execute("nmcli -g NAME,TYPE,DEVICE con") @@ -53,7 +56,7 @@ class Module(bumblebee.engine.Module): self._connected_vpn_profile = None for line in lines: info = line.split(':') - if info[1] == "vpn" and info[2] != "": + if self._isvpn(info[1]) and info[2] != "": self._connected_vpn_profile = info[0] except Exception as e: