nic: add click handler

This commit is contained in:
Ludwig Behm 2023-11-08 22:56:23 +01:00
parent 2e18d71284
commit 900a0710c5
Signed by: l.behm
GPG key ID: D344835D63B89384

View file

@ -25,6 +25,7 @@ import subprocess
import core.module import core.module
import core.decorators import core.decorators
import core.input
import util.cli import util.cli
import util.format import util.format
@ -58,6 +59,8 @@ class Module(core.module.Module):
self.iw = shutil.which("iw") self.iw = shutil.which("iw")
self._update_widgets(widgets) self._update_widgets(widgets)
core.input.register(self, button=core.input.LEFT_MOUSE, cmd='/usr/local/bin/wifi-menu')
core.input.register(self, button=core.input.RIGHT_MOUSE, cmd='nm-connection-editor')
def update(self): def update(self):
self._update_widgets(self.widgets()) self._update_widgets(self.widgets())
@ -88,7 +91,7 @@ class Module(core.module.Module):
def _iswlan(self, intf): def _iswlan(self, intf):
# wifi, wlan, wlp, seems to work for me # wifi, wlan, wlp, seems to work for me
if intf.startswith("w"): if intf.startswith("w") and not intf.startswith("wwan"):
return True return True
return False return False