parent
3a376a4ad2
commit
d57bbc28fe
1 changed files with 5 additions and 2 deletions
|
@ -38,7 +38,7 @@ class Module(bumblebee.engine.Module):
|
||||||
for line in lines:
|
for line in lines:
|
||||||
info = line.split(':')
|
info = line.split(':')
|
||||||
try:
|
try:
|
||||||
if info[1] == "vpn":
|
if self._isvpn(info[1]):
|
||||||
self._vpn_profiles.append(info[0])
|
self._vpn_profiles.append(info[0])
|
||||||
except:
|
except:
|
||||||
pass
|
pass
|
||||||
|
@ -46,6 +46,9 @@ class Module(bumblebee.engine.Module):
|
||||||
engine.input.register_callback(self, button=bumblebee.input.LEFT_MOUSE,
|
engine.input.register_callback(self, button=bumblebee.input.LEFT_MOUSE,
|
||||||
cmd=self.popup)
|
cmd=self.popup)
|
||||||
|
|
||||||
|
def _isvpn(self, connection_type):
|
||||||
|
return connection_type in ["vpn", "wireguard"]
|
||||||
|
|
||||||
def update(self, widgets):
|
def update(self, widgets):
|
||||||
try:
|
try:
|
||||||
res = bumblebee.util.execute("nmcli -g NAME,TYPE,DEVICE con")
|
res = bumblebee.util.execute("nmcli -g NAME,TYPE,DEVICE con")
|
||||||
|
@ -53,7 +56,7 @@ class Module(bumblebee.engine.Module):
|
||||||
self._connected_vpn_profile = None
|
self._connected_vpn_profile = None
|
||||||
for line in lines:
|
for line in lines:
|
||||||
info = line.split(':')
|
info = line.split(':')
|
||||||
if info[1] == "vpn" and info[2] != "":
|
if self._isvpn(info[1]) and info[2] != "":
|
||||||
self._connected_vpn_profile = info[0]
|
self._connected_vpn_profile = info[0]
|
||||||
|
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
|
|
Loading…
Reference in a new issue