Complete guide to setting up a persistent Wi-Fi connection in Hyprland using NetworkManager, nm-applet, KWallet, or gnome-keyring, considering system connections.
- Hyprland: A Wayland window manager without native KWallet (KDE Plasma) integration.
- NetworkManager: Network management tool, used with
plasma-nm(KDE) ornm-applet(GTK). - Issue: Wi-Fi passwords stored in KWallet (Plasma) are inaccessible in Hyprland with
nm-appletornmtui, preventing automatic connection. - System Connection: Stores passwords in plain text in
/etc/NetworkManager/system-connections/(root-only read access), available to all users.
nm-applet is a lightweight graphical interface for NetworkManager, ideal for Hyprland.
-
Install
nm-applet:sudo pacman -S network-manager-applet
(Adapt for your distribution:
apt,dnf, etc.) -
Launch
nm-appletautomatically: Add to~/.config/hypr/hyprland.conf:exec-once = nm-applet --indicatorThis displays an icon in the system tray (e.g., with
waybar). -
Configure Wi-Fi:
- Click the
nm-appleticon. - Select your Wi-Fi network, enter the password.
- Passwords are stored in the default keyring (
gnome-keyring, KWallet, or in plain text if no keyring is configured).
- Click the
-
KWallet Integration (Optional):
- Ensure
kwalletdis running:
(Verify the path for your distribution.)exec-once = /usr/lib/kdewalletd6 - If KWallet fails, switch to a system connection or
gnome-keyring.
- Ensure
For a keyring compatible with nm-applet outside KDE:
-
Install
gnome-keyring:sudo pacman -S gnome-keyring
-
Launch
gnome-keyringin Hyprland: Add to~/.config/hypr/hyprland.conf:exec-once = /usr/lib/gnome-keyring-daemon --start --components=pkcs11,secrets -
Configure Wi-Fi with
nm-applet:- Passwords will be stored in
gnome-keyring.
- Passwords will be stored in
For a Wi-Fi connection accessible without a keyring (password in plain text, secured for root):
-
Create a connection with
nmcli:sudo nmcli con add type wifi con-name "MyWiFi" ifname wlan0 ssid "YOUR_SSID" -- wifi-sec.key-mgmt wpa-psk wifi-sec.psk "YOUR_PASSWORD"
-
Verify the configuration file:
- The file is created in
/etc/NetworkManager/system-connections/MyWiFi.nmconnection. - Check permissions (root-only read access):
sudo ls -l /etc/NetworkManager/system-connections/
- The file is created in
-
Activate the connection:
nmcli con up MyWiFi
- KWallet Issue: If KWallet blocks access in Hyprland, use
gnome-keyringor a system connection. - System Tray: Ensure a compatible tray (e.g.,
waybar) is used to display thenm-appleticon. - Troubleshooting:
- Check NetworkManager status:
systemctl status NetworkManager. - View logs:
journalctl -u NetworkManager.
- Check NetworkManager status:
- Clearer Structure: Sections reorganized for logical progression (context → solutions → tips).
- Conciseness: Simplified text, removed redundancies, and streamlined technical explanations.
- System Connection Added: Clear instructions for creating a system connection with
nmcli, a robust solution to avoid keyring issues. - Markdown Formatting: Used headings, lists, and code blocks for better readability.
- Practical Tips: Added troubleshooting commands and useful resources.
- Generalization: Instructions adapted for various distributions (not just Arch Linux).
- Updated: Text modernized to reflect current tools (e.g.,
kdewalletd6for recent KDE versions).