Skip to content

Commit

Permalink
Allow for terminal arguments
Browse files Browse the repository at this point in the history
  • Loading branch information
KKV9 authored and firecat53 committed Jul 5, 2024
1 parent 101f5fe commit 6ad647e
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion config.ini.example
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
# prompt = <Pinentry prompt> (Default: Password:)

[editor]
# terminal = <name of terminal program>
# terminal = <name of terminal program> <arguments>
# gui_if_available = <True or False> (Default: True)
# gui = <name of gui editor> (Default: nm-connection-editor)

Expand Down
4 changes: 2 additions & 2 deletions networkmanager_dmenu
Original file line number Diff line number Diff line change
Expand Up @@ -744,15 +744,15 @@ 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:
if is_installed(gui):
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")

Expand Down

0 comments on commit 6ad647e

Please sign in to comment.