#!/bin/bash # # Purpose : Leave Wi-Fi to NetworkManager alone. archinstall's "copy ISO network # configuration" turns on iwd and systemd-networkd, so a machine set # up with iwctl from the Arch ISO can have them running alongside # NetworkManager, which CoreDesktop turns on. Then two services fight # over the Wi-Fi card: connections drop, or Wi-Fi is missing from # GNOME. # # This disables iwd and systemd-networkd without stopping them, so the network # stays up until the next boot; after it, NetworkManager runs Wi-Fi and wired # connections. iwd's saved Wi-Fi passwords don't carry over: choose the network # once in GNOME's top-right menu. # # Changes nothing when NetworkManager isn't enabled, or when it is set up to # use iwd itself (wifi.backend=iwd in /etc/NetworkManager/conf.d/). systemctl is-enabled -q NetworkManager.service 2> /dev/null || exit 0 systemctl is-enabled -q iwd.service 2> /dev/null || exit 0 # Unset settings print commented out, so this matches only one someone set if NetworkManager --print-config 2> /dev/null \ | grep -qE '^[[:space:]]*wifi\.backend[[:space:]]*=[[:space:]]*iwd[[:space:]]*$'; then exit 0 fi echo "Turning off iwd, so that NetworkManager runs Wi-Fi from the next restart..." sudo systemctl disable iwd.service || exit 1 # archinstall turns systemd-networkd on with iwd. Its wait-online would hold up # boot with nothing for it to wait for. if systemctl is-enabled -q systemd-networkd.service 2> /dev/null; then echo "Turning off systemd-networkd, so that NetworkManager runs the network..." sudo systemctl disable systemd-networkd.service systemd-networkd.socket \ systemd-networkd-wait-online.service || exit 1 fi echo "After you restart, choose your Wi-Fi network in GNOME's top-right menu" echo "and enter its password once. The network stays up until then."