Manage NetworkManager connections with dmenu, Rofi or Bemenu instead of nm-applet
WARNING Two breaking changes 2021-12-08
- ALL menu configuration moved to
dmenu_command
, including-i
. Note options changed in config.ini.example - Minimum Python version now 3.7
- Connect to existing NetworkManager wifi or wired connections
- Connect to new wifi connections. Requests passphrase if required
- Connect to existing VPN, Wireguard, GSM/WWAN and Bluetooth connections
- Enable/Disable wifi, WWAN, bluetooth and networking
- Launch nm-connection-editor GUI
- Support for multiple wifi adapters
- Optional Pinentry support for secure passphrase entry
- Delete existing connections
- Rescan wifi networks
- Uses notify-send for notifications if available
-
Copy script somewhere into $PATH OR
- Archlinux: AUR package OR
- Gentoo: Woomy Overlay
- Python 3.7+
- NetworkManager
- Dmenu, Rofi or bemenu
- Python gobject (PyGObject, python-gobject, etc.)
- (Debian/Ubuntu based distros) libnm-util-dev and gir1.2-nm-1.0 (you have to explicitly install the latter on Debian Sid)
- (optional) The network-manager-applet package (in order to launch the GUI connection editor, if desired. The nm-applet does not need to be started.)
- (optional) Pinentry. Make sure to set which flavor of pinentry command to use in the config file.
- (optional) ModemManager for WWAN support.
- (optional) notify-send for notifications (connected, disconnected, etc.)
- To customize behavior, copy config.ini.example to ~/.config/networkmanager-dmenu/config.ini and edit.
- All theming is done through the respective menu programs. Set
dmenu_command
with the desired options, including things like-i
for case insensitivity. See config.ini.example for examples. - If using dmenu for passphrase entry (pinentry not set), dmenu options in the
[dmenu_passphrase]
section of config.ini will set the normal foreground and background colors to be the same to obscure the passphrase. The Suckless password patch-P
option is supported if that patch is installed. Rofi and bemenu will use their respective flags for passphrase entry. - Set default terminal (xterm, urxvtc, etc.) command in config.ini if desired.
- Saved connections can be listed if desired. Set
list_saved = True
under[dmenu]
in config.ini. If set toFalse
, saved connections are still accessible under a "Saved connections" sub-menu. - If desired, copy the networkmanager_dmenu.desktop to /usr/share/applications or ~/.local/share/applications.
- If you want to run the script as $USER instead of ROOT, set PolicyKit permissions. The script is usable for connecting to pre-existing connections without setting these, but you won't be able to enable/disable networking or add new connections.
Section | Key | Default | Notes |
---|---|---|---|
[dmenu] |
compact |
False |
|
dmenu_command |
dmenu |
Command can include arguments | |
list_saved |
False |
||
pinentry |
None | ||
rofi_highlight |
False |
||
wifi_chars |
None | String of 4 unicode characters | |
[dmenu_passphrase] |
obscure |
False |
|
obscure_color |
#222222 |
Only applicable to dmenu | |
[editor] |
gui_if_available |
True |
|
terminal |
xterm |
networkmanager_dmenu [-h] <menu args>
- Run script or bind to keystroke combination
- If desired, menu options can be passed on the command line instead of or in addition to the config file. These will override options in the config file.