A comprehensive NetworkManager interface for Emacs, providing complete control over network connections via D-Bus API. Manage WiFi, VPN, and network devices directly from Emacs with an intuitive interface.
- Complete NetworkManager Control: Full D-Bus API integration
- WiFi Management: Scan, connect, disconnect, and manage WiFi networks
- VPN Support: OpenVPN, WireGuard, L2TP, and more
- Device Management: Control network interfaces and their states
- Connection Profiles: Create, edit, and manage network connections
- Interactive UI: User-friendly interface with real-time updates
- Tabulated List UI: Enhanced sortable table views for WiFi, connections, and devices
- Connection Editor: Create and edit connections with interactive forms
- Modeline Indicator: Optional modeline display with customizable icons
- Auto-refresh: Automatic status updates with configurable interval
- Security: Support for WPA/WPA2/WPA3 and various VPN protocols
- Notifications: Desktop notifications for network state changes
- Export/Import: Backup and restore connection profiles
- which-key Support: Enhanced keybinding discovery with which-key integration
This version introduces significant improvements to the user interface and experience:
- Complete migration from text-based UI to
tabulated-list-modefor all views - Consistent, sortable columns with proper alignment
- Better keyboard navigation and standard Emacs list interactions
- Color-coded signal strength indicators:
- Excellent (75-100%): Green, bold
- Good (50-74%): Lime green
- Fair (25-49%): Yellow
- Poor (0-24%): Orange red
- Security indicators: Open networks shown in red
- Device state colors: Connected (green), disconnected (gray), unavailable (red)
- Active connection highlighting: Active connections shown in green
- Comprehensive overview accessible via
C-c N u - Shows system state, connectivity, and active connections
- Quick access to all NetworkManager functions
- Real-time status updates
- New tooltips showing connection details on hover
- Customizable display format: icon-only, text-only, or icon-and-text
- Improved formatting for all connection types
- Clickable buttons in connections list for New/Edit/Delete actions
- Better integration with mouse interactions
- Improved keyboard shortcuts across all modes
- Proper timer management for all tabulated modes
- Automatic cleanup when buffers are killed
- Configurable refresh intervals
- Emacs 30.1 or later
- D-Bus support compiled into Emacs (check with
(featurep 'dbusbind)) - NetworkManager service running on your system
- Optional:
which-keypackage for enhanced keybinding discovery
(use-package nm
:vc (:url "https://github.com/theesfeld/nm")
:ensure t
:init
;; Core NetworkManager settings (before package loads)
(setq nm-auto-refresh t ; Auto-refresh network status
nm-refresh-interval 5 ; Refresh every 5 seconds
nm-service "org.freedesktop.NetworkManager" ; D-Bus service name
nm-path "/org/freedesktop/NetworkManager" ; D-Bus object path
nm-settings-path "/org/freedesktop/NetworkManager/Settings") ; Settings path
:config
;; Enable optional features
(nm-modeline-mode 1) ; Show connection status in modeline
(nm-notify-mode 1) ; Enable desktop notifications
;; Modeline customization - Display format (NEW in v0.4.0)
(setq nm-modeline-display-format 'icon-and-text ; Choose display format:
; 'icon-only - Shows only icons
; 'text-only - Shows only connection text
; 'icon-and-text - Shows both (default)
nm-modeline-format " %s" ; Format string (%s = status)
nm-modeline-refresh-interval 5 ; Update interval in seconds
nm-modeline-show-vpn t) ; Show VPN status
;; Modeline icons - Connection types (emoji style)
(setq nm-modeline-disconnected-icon "β " ; No connection
nm-modeline-ethernet-icon "π§" ; Ethernet connection
nm-modeline-wifi-icon "πΆ" ; WiFi base icon
nm-modeline-vpn-icon "π") ; VPN active
;; WiFi signal strength icons
(setq nm-modeline-wifi-icons
'((high . "ββββ") ; 75-100% signal
(medium . "βββ_") ; 50-74% signal
(low . "ββ__") ; 25-49% signal
(none . "β___"))) ; 0-24% signal
;; Alternative: Use Nerd Fonts (requires Nerd Font installed)
;; Uncomment below to use Nerd Font icons instead of emoji
;; (setq nm-modeline-use-nerd-fonts t
;; nm-modeline-nerd-icons
;; '((disconnected . "") ; nf-md-wifi_off
;; (ethernet . "") ; nf-md-ethernet
;; (wifi-high . "") ; nf-md-wifi_strength_4
;; (wifi-medium . "") ; nf-md-wifi_strength_3
;; (wifi-low . "") ; nf-md-wifi_strength_2
;; (wifi-none . "") ; nf-md-wifi_strength_1
;; (vpn . ""))) ; nf-md-shield_key
;; Notification settings
(setq nm-notify-enabled t ; Enable notifications
nm-notify-use-notifications-lib t ; Use desktop notifications
nm-notify-connect-message "Connected to %s"
nm-notify-disconnect-message "Disconnected from %s"
nm-notify-state-change-message "Network state: %s"
nm-notify-vpn-connect-message "VPN connected: %s"
nm-notify-vpn-disconnect-message "VPN disconnected: %s")
;; Security settings - auth-source integration
(setq nm-secrets-use-auth-source t ; Use Emacs auth-source
nm-secrets-auth-source-host "NetworkManager" ; Host for auth entries
auth-sources '("~/.authinfo.gpg")) ; Encrypted password storage
;; UI buffer names (customize if you prefer different names)
(setq nm-ui-buffer-name "*NetworkManager*"
nm-ui-wifi-buffer-name "*NetworkManager WiFi*"
nm-ui-connection-buffer-name "*NetworkManager Connection*"
nm-ui-devices-buffer-name "*NetworkManager Devices*"
nm-ui-ethernet-buffer-name "*NetworkManager Ethernet*")
;; UI behavior settings (advanced customization)
;; These are usually set via defvar, but can be customized if needed
;; (setq nm-ui-use-tabulated-list t ; Use enhanced table views
;; nm-ui-wifi-auto-scan t ; Auto-scan when opening WiFi browser
;; nm-ui-connections-show-auto t) ; Show autoconnect connections
:bind-keymap
;; Main prefix key for all NetworkManager commands
("C-c N" . nm-prefix-map)
:bind
;; Quick access bindings (optional - in addition to prefix map)
(("C-c n s" . nm-status) ; Quick status check
("C-c n w" . nm-ui-wifi) ; Jump to WiFi browser
("C-c n c" . nm-ui-connections) ; Jump to connections
("C-c n d" . nm-ui-dashboard) ; Open dashboard
("C-c n n" . nm-toggle-networking) ; Toggle networking
("C-c n W" . nm-toggle-wireless)) ; Toggle wireless
:hook
;; Optional hooks for integration with other modes
;; Enable features on startup
((after-init . nm-modeline-mode) ; Enable modeline on startup
(after-init . nm-notify-mode)) ; Enable notifications on startup
;; You can also hook into specific major modes if needed
;; ((some-mode . (lambda () (nm-modeline-mode 1))))
:custom-face
;; Optional face customizations for UI elements
;; Uncomment and modify to customize appearance
;; (nm-ui-signal-excellent ((t (:foreground "green" :weight bold))))
;; (nm-ui-signal-good ((t (:foreground "lime green"))))
;; (nm-ui-signal-fair ((t (:foreground "yellow"))))
;; (nm-ui-signal-poor ((t (:foreground "orange red"))))
;; (nm-ui-security-open ((t (:foreground "red"))))
;; (nm-ui-active-connection ((t (:foreground "green" :weight bold))))
;; (nm-ui-device-connected ((t (:foreground "green"))))
;; (nm-ui-device-disconnected ((t (:foreground "gray"))))
;; (nm-ui-device-unavailable ((t (:foreground "red"))))
)Clone the repository and add to your load path:
git clone https://github.com/theesfeld/nm ~/.emacs.d/site-lisp/nmThen add to your Emacs configuration:
(add-to-list 'load-path "~/.emacs.d/site-lisp/nm")
(require 'nm)
(global-set-key (kbd "C-c N") nm-prefix-map)After installation, you can quickly access NetworkManager features:
- Check status:
C-c N s- Shows NetworkManager status - Open dashboard:
C-c N u- Opens the NetworkManager dashboard - Browse WiFi:
C-c N W- Opens WiFi browser and starts scanning - Manage connections:
C-c N c- Opens connection manager - Help:
C-c N ?- Shows all available keybindings
For interactive use, the UI modes provide the most convenient interface:
M-x nm-ui- Main dashboard with status overviewM-x nm-ui-wifi- WiFi network browser with connect/disconnectM-x nm-ui-connections- Connection profile managerM-x nm-ui-devices- Device management interface
All customizable variables with their default values:
| Variable | Default | Description |
|---|---|---|
nm-service |
"org.freedesktop.NetworkManager" |
D-Bus service name for NetworkManager |
nm-path |
"/org/freedesktop/NetworkManager" |
D-Bus object path for NetworkManager |
nm-settings-path |
"/org/freedesktop/NetworkManager/Settings" |
D-Bus object path for NetworkManager Settings |
nm-auto-refresh |
t |
Whether to automatically refresh network status |
nm-refresh-interval |
5 |
Interval in seconds for automatic refresh |
| Variable | Default | Description |
|---|---|---|
nm-modeline-format |
" %s" |
Format string for modeline display |
nm-modeline-refresh-interval |
5 |
Refresh interval in seconds |
nm-modeline-display-format |
'icon-and-text |
Display format: icon-only, text-only, or icon-and-text |
nm-modeline-show-vpn |
t |
Whether to show VPN status |
nm-modeline-disconnected-icon |
"β " |
Icon when disconnected |
nm-modeline-ethernet-icon |
"π§" |
Icon for ethernet connection |
nm-modeline-wifi-icon |
"πΆ" |
Icon for WiFi connection |
nm-modeline-wifi-icons |
alist | Icons for different WiFi strengths |
nm-modeline-vpn-icon |
"π" |
Icon for VPN connection |
nm-modeline-use-nerd-fonts |
nil |
Use Nerd Font icons instead of emoji |
nm-modeline-nerd-icons |
alist | Customizable Nerd Font icons |
You can customize WiFi strength icons separately:
(setq nm-modeline-wifi-icons
'((high . "πΆ") ;; 75-100% signal
(medium . "πΆ") ;; 50-74% signal
(low . "πΆ") ;; 25-49% signal
(none . "πΆ"))) ;; 0-24% signalOr use custom Nerd Font icons:
(setq nm-modeline-use-nerd-fonts t)
(setq nm-modeline-nerd-icons
'((disconnected . "")
(ethernet . "")
(wifi-high . "")
(wifi-medium . "")
(wifi-low . "")
(wifi-none . "")
(vpn . "")))
### Notification Options
| Variable | Default | Description |
|-----------------------------------|-----------------------|------------------------------------------|
| `nm-notify-enabled` | `t` | Enable desktop notifications |
| `nm-notify-use-notifications-lib` | `t` | Use notifications library if available |
| `nm-notify-connect-message` | `"Connected to %s"` | Format for connection notifications |
| `nm-notify-disconnect-message` | `"Disconnected from %s"` | Format for disconnection notifications |
### UI Options
| Variable | Default | Description |
|-------------------------------|---------|---------------------------------------|
| `nm-ui-use-tabulated-list` | `t` | Use enhanced tabulated list views |
| `nm-ui-wifi-auto-scan` | `t` | Auto-scan when opening WiFi browser |
| `nm-ui-connections-show-auto` | `t` | Show autoconnect connections |
| `nm-ui-buffer-name` | `"*NetworkManager*"` | Main UI buffer name |
| `nm-ui-wifi-buffer-name` | `"*NetworkManager WiFi*"` | WiFi browser buffer |
## Usage
### Basic Operations
```elisp
;; Check NetworkManager status
(nm-status)
;; Check if NetworkManager is available
(nm-available-p)
;; Get NetworkManager version
(nm-get-version)
;; Check connectivity
(nm-connectivity-to-string (nm-get-connectivity))
;; Toggle networking on/off
(nm-toggle-networking)
;; Toggle wireless on/off
(nm-toggle-wireless);; Scan for WiFi networks
(nm-wifi-scan-all)
;; Get all available access points
(nm-wifi-get-all-access-points)
;; Connect to open WiFi
(nm-wifi-connect "MyNetwork")
;; Connect to secured WiFi
(nm-wifi-connect "SecureNetwork" "password")
;; Connect to hidden network
(nm-wifi-connect "HiddenNetwork" "password" t)
;; Connect to specific BSSID
(nm-wifi-connect "MyNetwork" "password" nil "AA:BB:CC:DD:EE:FF")
;; Disconnect current WiFi
(nm-wifi-disconnect)
;; Forget a saved network
(nm-wifi-forget-network "OldNetwork")
;; Set network autoconnect
(nm-wifi-set-autoconnect "MyNetwork" t)
;; Create WiFi hotspot
(nm-wifi-create-hotspot "MyHotspot" "password123")
;; Create hotspot with band selection
(nm-wifi-create-hotspot "MyHotspot" "password123" "bg");; List all connections
(nm-connections-info)
;; Get active connections
(nm-active-connections-info)
;; Get connection settings
(nm-connection-get-settings connection-path)
;; Activate a connection by path
(nm-activate-connection connection-path device-path "/")
;; Add and activate a new connection
(nm-add-and-activate-connection settings device-path "/")
;; Deactivate a connection
(nm-deactivate-connection active-connection-path)
;; Delete a connection
(nm-connection-delete connection-path)
;; Create new Ethernet connection
(nm-create-ethernet-connection "Work LAN")
;; Create Ethernet connection with static IP
(nm-create-ethernet-connection "Work LAN" "192.168.1.100/24")
;; Create WiFi connection (returns settings dict)
(nm-create-wifi-connection "MyNetwork" "password")
;; Create hidden WiFi connection
(nm-create-wifi-connection "HiddenNetwork" "password" t)
;; Update connection settings
(nm-connection-update settings)
;; Get connection by UUID
(nm-get-connection-by-uuid uuid);; List VPN connections
(nm-vpn-get-connections)
;; Get active VPN connections
(nm-vpn-get-active-connections)
;; Activate VPN
(nm-vpn-activate "MyVPN")
;; Deactivate VPN
(nm-vpn-deactivate "MyVPN")
;; Deactivate all VPNs
(nm-vpn-deactivate-all)
;; Import VPN configuration (supports .ovpn, .conf, .wg)
(nm-vpn-import-config "/path/to/config.ovpn")
;; Create OpenVPN connection
(nm-vpn-create-openvpn "Work VPN" "/path/to/config.ovpn")
;; Create OpenVPN with credentials
(nm-vpn-create-openvpn "Work VPN" "/path/to/config.ovpn" "username" "password")
;; Create WireGuard connection
(nm-vpn-create-wireguard "WG-VPN"
"private-key"
"server:51820"
"public-key")
;; Create WireGuard with preshared key
(nm-vpn-create-wireguard "WG-VPN"
"private-key"
"server:51820"
"public-key"
"preshared-key")
;; Create L2TP connection
(nm-vpn-create-l2tp "L2TP-VPN"
"vpn.example.com"
"username"
"password"
"preshared-key")
;; Set VPN autoconnect
(nm-vpn-set-autoconnect "MyVPN" t)
;; Get VPN kill switch status
(nm-vpn-get-kill-switch "MyVPN")
;; Enable VPN kill switch
(nm-vpn-set-kill-switch "MyVPN" t);; List all devices
(nm-devices-info)
;; Get device state
(nm-device-get-state device-path)
;; Get device state as string
(nm-dbus-device-state-to-string (nm-device-get-state device-path))
;; Set device managed state
(nm-device-set-managed device-path t)
;; Set device autoconnect
(nm-device-set-autoconnect device-path t)
;; Disconnect device
(nm-device-disconnect device-path)
;; Get device IP configuration
(nm-device-get-ip4-config device-path)
;; Get device IPv6 configuration
(nm-device-get-ip6-config device-path)
;; Request wireless scan on device
(nm-device-wireless-request-scan device-path)
;; Get available connections for device
(nm-device-get-available-connections device-path)
;; Get device driver
(nm-device-get-driver device-path)
;; Get device firmware version
(nm-device-get-firmware-version device-path)After loading the package, all commands are available under C-c N:
| Key | Command | Description |
|---|---|---|
C-c N s |
nm-status |
Show NetworkManager status |
C-c N n |
nm-toggle-networking |
Toggle networking on/off |
C-c N w |
nm-toggle-wireless |
Toggle wireless on/off |
C-c N u |
nm-ui-dashboard |
Open NetworkManager dashboard |
C-c N W |
nm-ui-wifi |
Open WiFi browser |
C-c N E |
nm-ui-ethernet |
Open Ethernet browser |
C-c N d |
nm-ui-devices |
Open device list |
C-c N c |
nm-ui-connections |
Open connections manager |
C-c N v |
nm-vpn-activate |
Activate VPN (with completion) |
C-c N V |
nm-vpn-deactivate-all |
Deactivate all VPNs |
C-c N r |
nm-reload |
Reload NetworkManager config |
C-c N ? |
nm-show-help |
Show all keybindings |
C-c N T w |
nm-ui-wifi-list |
WiFi list (tabulated mode) |
C-c N T c |
nm-ui-connections-list |
Connections (tabulated mode) |
C-c N T d |
nm-ui-devices-list |
Devices (tabulated mode) |
If you have which-key installed, pressing C-c N will show all available commands with descriptions.
Launch the main NetworkManager interface:
M-x nm-ui
Key bindings:
| Key | Command | Description |
|---|---|---|
g |
nm-ui-refresh |
Refresh display |
q |
quit-window |
Quit window |
n |
nm-toggle-networking |
Toggle networking on/off |
w |
nm-toggle-wireless |
Toggle wireless on/off |
s |
nm-status |
Show status |
u |
nm-ui |
Dashboard |
W |
nm-ui-wifi |
Open WiFi browser |
E |
nm-ui-ethernet |
Open Ethernet browser |
d |
nm-ui-devices |
Open device list |
c |
nm-ui-connections |
Open connections list |
C |
nm-ui-connections |
Open connections list |
v |
nm-vpn-activate |
Activate VPN |
V |
nm-vpn-deactivate-all |
Deactivate all VPNs |
r |
nm-reload |
Reload config |
? |
nm-show-help |
Show help |
Browse and connect to WiFi networks:
M-x nm-ui-wifi
Key bindings:
| Key | Command | Description |
|---|---|---|
g |
nm-ui-refresh |
Refresh network list |
s |
nm-ui-scan-wifi |
Scan for WiFi networks |
S |
nm-status |
Show status |
q |
quit-window |
Quit window |
RET |
nm-ui-connect-to-network |
Connect to network at point |
d |
nm-ui-disconnect |
Disconnect current network |
f |
nm-ui-forget-network |
Forget network at point |
n |
nm-toggle-networking |
Toggle networking on/off |
w |
nm-toggle-wireless |
Toggle wireless on/off |
u |
nm-ui |
Dashboard |
W |
nm-ui-wifi |
WiFi browser |
E |
nm-ui-ethernet |
Ethernet browser |
l |
nm-ui-devices |
Device list |
c |
nm-ui-connections |
Connections |
v |
nm-vpn-activate |
Activate VPN |
V |
nm-vpn-deactivate-all |
Deactivate all VPNs |
? |
nm-show-help |
Show help |
Manage network connection profiles:
M-x nm-ui-connections
Key bindings:
| Key | Command | Description |
|---|---|---|
g |
nm-ui-refresh |
Refresh connections list |
q |
quit-window |
Quit window |
RET |
nm-ui-activate-connection |
Activate connection |
a |
nm-ui-activate-connection |
Activate connection |
d |
nm-ui-deactivate-connection |
Deactivate connection |
e |
nm-ui-edit-connection |
Edit connection |
+ |
nm-ui-new-connection |
Create new connection |
D |
nm-ui-delete-connection |
Delete connection |
s |
nm-status |
Show status |
n |
nm-toggle-networking |
Toggle networking on/off |
w |
nm-toggle-wireless |
Toggle wireless on/off |
u |
nm-ui |
Dashboard |
W |
nm-ui-wifi |
WiFi browser |
E |
nm-ui-ethernet |
Ethernet browser |
c |
nm-ui-connections |
Connections |
l |
nm-ui-devices |
Device list |
v |
nm-vpn-activate |
Activate VPN |
V |
nm-vpn-deactivate-all |
Deactivate all VPNs |
r |
nm-reload |
Reload config |
? |
nm-show-help |
Show help |
Browse and manage Ethernet devices:
M-x nm-ui-ethernet
Key bindings:
| Key | Command | Description |
|---|---|---|
g |
nm-ui-refresh |
Refresh device list |
q |
quit-window |
Quit window |
RET |
nm-ui-activate-ethernet-device |
Activate device |
a |
nm-ui-activate-ethernet-device |
Activate device |
d |
nm-ui-disconnect-device |
Disconnect device |
s |
nm-status |
Show status |
n |
nm-toggle-networking |
Toggle networking on/off |
w |
nm-toggle-wireless |
Toggle wireless on/off |
u |
nm-ui |
Dashboard |
W |
nm-ui-wifi |
WiFi browser |
E |
nm-ui-ethernet |
Ethernet browser |
l |
nm-ui-devices |
Device list |
c |
nm-ui-connections |
Connections |
v |
nm-vpn-activate |
Activate VPN |
V |
nm-vpn-deactivate-all |
Deactivate all VPNs |
r |
nm-reload |
Reload config |
? |
nm-show-help |
Show help |
View and manage all network devices:
M-x nm-ui-devices
Key bindings:
| Key | Command | Description |
|---|---|---|
g |
nm-ui-refresh |
Refresh device list |
q |
quit-window |
Quit window |
RET |
nm-ui-show-device-details |
Show device details |
m |
nm-ui-toggle-device-managed |
Toggle managed state |
a |
nm-ui-toggle-device-autoconnect |
Toggle autoconnect |
d |
nm-ui-disconnect-device |
Disconnect device |
s |
nm-status |
Show status |
n |
nm-toggle-networking |
Toggle networking on/off |
w |
nm-toggle-wireless |
Toggle wireless on/off |
u |
nm-ui |
Dashboard |
W |
nm-ui-wifi |
WiFi browser |
E |
nm-ui-ethernet |
Ethernet browser |
l |
nm-ui-devices |
Device list |
c |
nm-ui-connections |
Connections |
v |
nm-vpn-activate |
Activate VPN |
V |
nm-vpn-deactivate-all |
Deactivate all VPNs |
r |
nm-reload |
Reload config |
? |
nm-show-help |
Show help |
The package includes enhanced tabulated-list-mode interfaces for better data presentation:
Displays WiFi networks in a sortable table:
M-x nm-ui-wifi-list
Features:
- Sortable columns (SSID, Channel, Security, Strength)
- Visual signal strength indicators
- Current connection highlighted
- Auto-refresh on scan
Key bindings:
RETorc- Connect to networkd- Disconnect current networkf- Forget networks- Scan for networksS- Sort by column at point
Manage connections in a tabulated view:
M-x nm-ui-connections-list
Features:
- Shows all saved connections with status
- Active connections highlighted
- Sortable by name, type, or status
Key bindings:
RETora- Activate connectiond- Deactivate connectione- Edit connectionD- Delete connection+- Create new connection
View all network devices:
M-x nm-ui-devices-list
Features:
- Shows interface, type, state, driver
- Sortable columns
- Manage device settings
Key bindings:
RET- Show device detailsm- Toggle managed statea- Toggle autoconnectd- Disconnect device
Export and import connection profiles for backup or sharing:
;; Export single connection
(nm-connection-export connection-path "/path/to/file.nmconnection")
;; Export all connections
(nm-connection-export-all "/path/to/backup-directory/")
;; Import single connection
(nm-connection-import "/path/to/file.nmconnection")
;; Import directory of connections
(nm-connection-import-directory "/path/to/backup-directory/")
;; Export in NetworkManager keyfile format
(nm-connection-export-keyfile connection-path "/path/to/file.conf")Interactive commands:
M-x nm-connection-export-all- Export all connections to a directoryM-x nm-connection-import- Import a connection fileM-x nm-connection-import-directory- Import all connections from a directory
Enable desktop notifications for network state changes:
;; Enable notifications
(nm-notify-mode 1)
;; Customize notification messages
(setq nm-notify-connect-message "Connected to %s π")
(setq nm-notify-disconnect-message "Disconnected from %s π’")
(setq nm-notify-vpn-connect-message "VPN secure: %s π")
;; Use desktop notifications (requires notifications.el)
(setq nm-notify-use-notifications-lib t)Notifications are shown for:
- Connection/disconnection events
- VPN state changes
- Network state changes
- Connectivity changes
Core NetworkManager interface providing:
- Service availability checking
- Global state management
- Connectivity monitoring
- Networking and wireless control
- Primary connection tracking
Key functions:
nm-available-p: Check if NetworkManager is availablenm-get-state: Get global NetworkManager statenm-get-connectivity: Get connectivity statusnm-check-connectivity: Force connectivity checknm-enable-networking: Enable/disable networking
Low-level D-Bus interface providing:
- Method calls and property access
- Signal registration
- Data type conversion
- Settings serialization
Key functions:
nm-dbus-call-method: Synchronous D-Bus method callsnm-dbus-get-property: Get D-Bus propertiesnm-dbus-register-signal: Register signal handlersnm-dbus-connection-settings-to-alist: Convert settings to Elisp alistnm-dbus-alist-to-connection-settings: Convert alist to D-Bus format
Network device control providing:
- Device enumeration and properties
- State management
- Interface configuration
- Wired and wireless device control
Key functions:
nm-get-devices: List all network devicesnm-device-info: Get comprehensive device informationnm-device-disconnect: Disconnect a devicenm-device-set-managed: Set device managed statenm-device-wireless-request-scan: Request WiFi scan
Connection management providing:
- Profile creation and modification
- Connection activation/deactivation
- Settings management
- Active connection monitoring
Key functions:
nm-list-connections: List all saved connectionsnm-add-connection: Add new connection profilenm-activate-connection: Activate a connectionnm-connection-delete: Delete a connectionnm-connection-get-settings: Get connection settings
WiFi-specific functionality:
- Access point scanning and information
- Network connection with security
- Hotspot creation
- Signal strength visualization
Key functions:
nm-wifi-scan-all: Scan all WiFi devicesnm-wifi-connect: Connect to WiFi network with optional password, hidden, and BSSIDnm-wifi-connect-to-ap: Connect using access point info structurenm-wifi-get-all-access-points: Get all visible APs with detailsnm-wifi-disconnect: Disconnect current WiFinm-wifi-forget-network: Remove saved network profilenm-wifi-set-autoconnect: Configure network autoconnectnm-wifi-create-hotspot: Create WiFi hotspotnm-wifi-strength-bars: Visual signal strength indicatornm-wifi-get-current-connection: Get current WiFi connection info
VPN management supporting:
- Multiple VPN protocols (OpenVPN, WireGuard, L2TP)
- Connection import/export
- Profile creation
- State monitoring
- Kill switch configuration
Key functions:
nm-vpn-get-connections: List VPN connectionsnm-vpn-get-active-connections: Get active VPN connectionsnm-vpn-activate: Activate VPN by namenm-vpn-deactivate: Deactivate VPN by namenm-vpn-deactivate-all: Deactivate all active VPNsnm-vpn-create-openvpn: Create OpenVPN profilenm-vpn-create-wireguard: Create WireGuard profilenm-vpn-create-l2tp: Create L2TP profilenm-vpn-import-config: Import VPN configuration filenm-vpn-set-autoconnect: Configure VPN autoconnectnm-vpn-get-kill-switch: Get kill switch statusnm-vpn-set-kill-switch: Configure kill switch
Interactive interface providing:
- Status dashboard
- WiFi browser
- Connection manager
- Real-time updates
- Password prompts
Key functions:
nm-ui: Open main interfacenm-ui-wifi: Open WiFi browsernm-ui-connections: Open connection managernm-ui-refresh: Refresh current viewnm-ui-password-prompt: Secure password input
Optional modeline indicator showing:
- Current connection status
- Connection type (Ethernet/WiFi/VPN)
- WiFi signal strength
- VPN status indication
- Customizable icons (emoji or Nerd Fonts)
Enable the modeline indicator:
;; Enable modeline indicator
(nm-modeline-mode 1)
;; Use Nerd Font icons instead of emoji
(setq nm-modeline-use-nerd-fonts t)
;; Customize refresh interval
(setq nm-modeline-refresh-interval 10)
;; Hide VPN status
(setq nm-modeline-show-vpn nil)
;; Show only icons without connection names
(setq nm-modeline-display-format 'icon-only)
;; Or show only text without icons
(setq nm-modeline-display-format 'text-only)The modeline will display:
β Offline- No network connectionπ§ eth0- Ethernet connectionπΆ MyWiFi 85%- WiFi with signal strengthπ VPN- Active VPN connection
The display format can be customized with nm-modeline-display-format:
'icon-only- Shows only icons'text-only- Shows only connection text'icon-and-text- Shows both icons and text (default)
Hover over the modeline indicator to see full connection details in a tooltip.
Desktop notification support for network state changes:
- Connection established/lost notifications
- VPN connect/disconnect alerts
- Customizable notification messages
- Integration with system notification daemon
Enable notifications:
;; Enable desktop notifications
(nm-notify-mode 1)
;; Customize notification messages
(setq nm-notify-connect-message "Connected to %s π"
nm-notify-disconnect-message "Disconnected from %s β οΈ")
;; Use system notifications (requires notifications.el)
(setq nm-notify-use-notifications-lib t)Professional tabulated list views for:
- WiFi network browser with sortable columns
- Connection manager with filtering
- Device list with detailed information
Features:
- Sortable columns (click headers or use
S) - Filtering and searching
- Better performance with large lists
- Consistent UI across all views
The tabulated views are automatically used when available. To force classic views:
(setq nm-ui-use-tabulated-list nil)NetworkManager Emacs uses secure password handling:
- No passwords in memory: Passwords are cleared from memory immediately after use
- auth-source integration: Passwords can be stored in your encrypted auth-source backend
- No passwords in connection files: Passwords are never saved with connection profiles
Configure secure password storage:
;; Use auth-source for password storage (default: t)
(setq nm-secrets-use-auth-source t)
;; Customize auth-source backend (e.g., use GPG-encrypted file)
(setq auth-sources '("~/.authinfo.gpg"))When connecting to a secured network:
- First checks auth-source for saved passwords
- Prompts for password if not found
- Optionally saves to auth-source (with user confirmation)
- Clears password from memory after use
The package can act as a NetworkManager secret agent to handle authentication requests securely. This ensures passwords are only provided when NetworkManager needs them, not stored in connection profiles.
If you get "NetworkManager service not available" errors:
-
Check if NetworkManager is running:
systemctl status NetworkManager
-
Verify D-Bus is running:
systemctl status dbus
-
Ensure Emacs has D-Bus support:
(featurep 'dbusbind) ; Should return t
Enable D-Bus debugging:
(setq dbus-debug t)Check NetworkManager logs:
journalctl -u NetworkManager -fEnsure your user has permission to manage network connections:
(nm-get-permissions) ; Check available permissionsYou may need to configure PolicyKit rules for your user.
If WiFi scans don't show networks:
-
Check if wireless is enabled:
(nm-wireless-enabled-p)
-
Check hardware switch:
(nm-wireless-hardware-enabled-p)
-
Manually trigger scan:
(nm-wifi-scan-all)
Copyright (C) 2025 William Theesfeld william@theesfeld.net
This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program. If not, see https://www.gnu.org/licenses/.