The on-battery toggle bought a fraction of a watt while the radio idled -- twenty-some minutes across a full discharge in the best case -- and paid for it with 20-300ms latency spikes on idle links and outright link drops on Intel BE200/BE211 firmware. NetworkManager can keep power save off natively with one conf.d line, which replaces the udev rule, the setter script, and any per-card deny-listing. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
20 lines
499 B
Bash
20 lines
499 B
Bash
echo "Keep Wi-Fi power save off for lower latency"
|
|
|
|
as_root() {
|
|
if (( EUID == 0 )); then
|
|
"$@"
|
|
else
|
|
sudo "$@"
|
|
fi
|
|
}
|
|
|
|
as_root nmcli general reload conf >/dev/null 2>&1 || true
|
|
|
|
# NetworkManager only applies wifi.powersave when a connection activates, so
|
|
# also switch it off directly for the running session.
|
|
shopt -s nullglob
|
|
for wireless in /sys/class/net/*/wireless; do
|
|
iface=$(basename "$(dirname "$wireless")")
|
|
as_root iw dev "$iface" set power_save off 2>/dev/null || true
|
|
done
|