Add option to launch network config app when right/middle clicking network widget

This commit is contained in:
Kevin Alberts 2025-08-11 17:29:06 +02:00
parent a68f516f33
commit 812eb28abc
3 changed files with 7 additions and 1 deletions

View file

@ -31,6 +31,7 @@ class Config(BaseConfig):
file_manager = "thunar" file_manager = "thunar"
visualizer_app = "glava" visualizer_app = "glava"
web_browser = "firefox" web_browser = "firefox"
network_config = "true"
# Autostart applications # Autostart applications
apps_autostart_group = [ apps_autostart_group = [

View file

@ -11,6 +11,7 @@ class Config(GeneralConfig):
#app_terminal = "terminator" #app_terminal = "terminator"
cmd_brightness_up = "brightnessctl -d intel_backlight set +5%" cmd_brightness_up = "brightnessctl -d intel_backlight set +5%"
cmd_brightness_down = "brightnessctl -d intel_backlight set 5%-" cmd_brightness_down = "brightnessctl -d intel_backlight set 5%-"
network_config = "nm-applet"
#lock_command = "bash /home/kevin/bin/lock.sh" #lock_command = "bash /home/kevin/bin/lock.sh"
# Thermal indicator variables # Thermal indicator variables

View file

@ -17,7 +17,7 @@ from libqtile.widget.groupbox import GroupBox
from libqtile.command.base import expose_command from libqtile.command.base import expose_command
from kuro.utils.general import notify, BUTTON_LEFT, BUTTON_MIDDLE, BUTTON_RIGHT, BUTTON_DOWN, BUTTON_UP, BUTTON_MUTE, \ from kuro.utils.general import notify, BUTTON_LEFT, BUTTON_MIDDLE, BUTTON_RIGHT, BUTTON_DOWN, BUTTON_UP, BUTTON_MUTE, \
call_process call_process, execute
class DualPaneTextboxBase(base._Widget): class DualPaneTextboxBase(base._Widget):
@ -621,6 +621,7 @@ class NetworkInfoWidget(DualPaneTextboxBase):
('critical_color', "#ffffff", "Color when value is critical"), ('critical_color', "#ffffff", "Color when value is critical"),
('wireless_interface', "wifi0", "Wireless interface device name"), ('wireless_interface', "wifi0", "Wireless interface device name"),
('wired_interface', "enp7s0", "Wired interface device name"), ('wired_interface', "enp7s0", "Wired interface device name"),
('config_application', "true", "Application to launch when right/middle clicking"),
] ]
def __init__(self, **config): def __init__(self, **config):
@ -747,6 +748,9 @@ class NetworkInfoWidget(DualPaneTextboxBase):
notify(None, title, "{}\n\n{}".format(wifi_text, wired_text)) notify(None, title, "{}\n\n{}".format(wifi_text, wired_text))
else: else:
notify(None, title, "\n{}".format(wired_text)) notify(None, title, "\n{}".format(wired_text))
if button == BUTTON_LEFT or button == BUTTON_MIDDLE:
if self.config_application:
execute(self.config_application)
class BatteryInfoWidget(DualPaneTextboxBase): class BatteryInfoWidget(DualPaneTextboxBase):