Skip to content

Instantly share code, notes, and snippets.

@CarbabouSy
Created August 5, 2025 19:51
Show Gist options
  • Select an option

  • Save CarbabouSy/9a0b4e248eed462b05dcddddce6432aa to your computer and use it in GitHub Desktop.

Select an option

Save CarbabouSy/9a0b4e248eed462b05dcddddce6432aa to your computer and use it in GitHub Desktop.
Complete guide to setting up a persistent Wi-Fi connection in Hyprland using **NetworkManager**, **nm-applet**, **KWallet**, or **gnome-keyring**, considering system connections.

🔧 [Fix] Hyprland Not Saving Wi-Fi Passwords

Complete guide to setting up a persistent Wi-Fi connection in Hyprland using NetworkManager, nm-applet, KWallet, or gnome-keyring, considering system connections.

Context

  • Hyprland: A Wayland window manager without native KWallet (KDE Plasma) integration.
  • NetworkManager: Network management tool, used with plasma-nm (KDE) or nm-applet (GTK).
  • Issue: Wi-Fi passwords stored in KWallet (Plasma) are inaccessible in Hyprland with nm-applet or nmtui, preventing automatic connection.
  • System Connection: Stores passwords in plain text in /etc/NetworkManager/system-connections/ (root-only read access), available to all users.

Solutions

1. Using nm-applet in Hyprland

nm-applet is a lightweight graphical interface for NetworkManager, ideal for Hyprland.

Steps:

  1. Install nm-applet:

    sudo pacman -S network-manager-applet

    (Adapt for your distribution: apt, dnf, etc.)

  2. Launch nm-applet automatically: Add to ~/.config/hypr/hyprland.conf:

    exec-once = nm-applet --indicator
    

    This displays an icon in the system tray (e.g., with waybar).

  3. Configure Wi-Fi:

    • Click the nm-applet icon.
    • 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).
  4. KWallet Integration (Optional):

    • Ensure kwalletd is running:
      exec-once = /usr/lib/kdewalletd6
      
      (Verify the path for your distribution.)
    • If KWallet fails, switch to a system connection or gnome-keyring.

2. Using gnome-keyring (Alternative to KWallet)

For a keyring compatible with nm-applet outside KDE:

Steps:

  1. Install gnome-keyring:

    sudo pacman -S gnome-keyring
  2. Launch gnome-keyring in Hyprland: Add to ~/.config/hypr/hyprland.conf:

    exec-once = /usr/lib/gnome-keyring-daemon --start --components=pkcs11,secrets
    
  3. Configure Wi-Fi with nm-applet:

    • Passwords will be stored in gnome-keyring.

3. Setting Up a System Connection

For a Wi-Fi connection accessible without a keyring (password in plain text, secured for root):

Steps:

  1. 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"
  2. 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/
  3. Activate the connection:

    nmcli con up MyWiFi

Tips

  • KWallet Issue: If KWallet blocks access in Hyprland, use gnome-keyring or a system connection.
  • System Tray: Ensure a compatible tray (e.g., waybar) is used to display the nm-applet icon.
  • Troubleshooting:
    • Check NetworkManager status: systemctl status NetworkManager.
    • View logs: journalctl -u NetworkManager.

Resources

Improvements Made:

  1. Clearer Structure: Sections reorganized for logical progression (context → solutions → tips).
  2. Conciseness: Simplified text, removed redundancies, and streamlined technical explanations.
  3. System Connection Added: Clear instructions for creating a system connection with nmcli, a robust solution to avoid keyring issues.
  4. Markdown Formatting: Used headings, lists, and code blocks for better readability.
  5. Practical Tips: Added troubleshooting commands and useful resources.
  6. Generalization: Instructions adapted for various distributions (not just Arch Linux).
  7. Updated: Text modernized to reflect current tools (e.g., kdewalletd6 for recent KDE versions).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment