From 6ad647e7e3c7821bbad1f3ec2626183de35b6c6e Mon Sep 17 00:00:00 2001 From: KKV9 Date: Sat, 15 Jun 2024 00:59:06 +0100 Subject: [PATCH] Allow for terminal arguments --- README.md | 2 +- config.ini.example | 2 +- networkmanager_dmenu | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 56a4718..bc4090b 100644 --- a/README.md +++ b/README.md @@ -103,7 +103,7 @@ Manage NetworkManager connections with dmenu, [Rofi][1], [Bemenu][2], | | `obscure_color` | `#222222` | Only applicable to dmenu | | `[editor]` | `gui_if_available` | `True` | | | | `gui` | `nm-connection-editor` | | -| | `terminal` | `xterm` | | +| | `terminal` | `xterm` | Can include terminal arguments | | `[nmdm]` | `rescan_delay` | `5` | Adjust delay in re-opening nmdm following rescan | ## Usage diff --git a/config.ini.example b/config.ini.example index feb98e8..dbdae93 100644 --- a/config.ini.example +++ b/config.ini.example @@ -41,7 +41,7 @@ # prompt = (Default: Password:) [editor] -# terminal = +# terminal = # gui_if_available = (Default: True) # gui = (Default: nm-connection-editor) diff --git a/networkmanager_dmenu b/networkmanager_dmenu index 4eb83bd..a5e749f 100755 --- a/networkmanager_dmenu +++ b/networkmanager_dmenu @@ -744,7 +744,7 @@ def launch_connection_editor(): """Launch nmtui or the gui nm-connection-editor """ - terminal = CONF.get("editor", "terminal", fallback="xterm") + terminal = shlex.split(CONF.get("editor", "terminal", fallback="xterm")) gui_if_available = CONF.getboolean("editor", "gui_if_available", fallback=True) gui = CONF.get("editor", "gui", fallback="nm-connection-editor") if gui_if_available is True: @@ -752,7 +752,7 @@ def launch_connection_editor(): subprocess.run(gui, check=False) return if is_installed("nmtui"): - subprocess.run([terminal, "-e", "nmtui"], check=False) + subprocess.run(terminal + ["-e", "nmtui"], check=False) return notify("No network connection editor installed", urgency="critical")