Drop Wi-Fi power save toggling in favor of keeping it off
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>
This commit is contained in:
co-authored by
Claude Fable 5
parent
1d4077287b
commit
da157fb9c0
@@ -1,10 +0,0 @@
|
|||||||
#!/bin/bash
|
|
||||||
|
|
||||||
# omarchy:summary=Set Wi-Fi power save mode on wireless interfaces
|
|
||||||
# omarchy:args=<on|off>
|
|
||||||
|
|
||||||
shopt -s nullglob
|
|
||||||
for iface in /sys/class/net/*/wireless; do
|
|
||||||
iface="$(basename "$(dirname "$iface")")"
|
|
||||||
iw dev "$iface" set power_save "$1" 2>/dev/null
|
|
||||||
done
|
|
||||||
@@ -0,0 +1,5 @@
|
|||||||
|
# Keep Wi-Fi power save off: it trades 20-300ms latency spikes on idle links
|
||||||
|
# for a fraction of a watt while the radio idles, and broken firmware (Intel
|
||||||
|
# BE200/BE211) drops the link outright when it naps.
|
||||||
|
[connection]
|
||||||
|
wifi.powersave = 2
|
||||||
@@ -1,2 +0,0 @@
|
|||||||
SUBSYSTEM=="power_supply", ATTR{type}=="Mains", ATTR{online}=="0", RUN+="/usr/bin/systemd-run --no-block --collect --unit=omarchy-wifi-powersave-on /usr/bin/omarchy-wifi-powersave on"
|
|
||||||
SUBSYSTEM=="power_supply", ATTR{type}=="Mains", ATTR{online}=="1", RUN+="/usr/bin/systemd-run --no-block --collect --unit=omarchy-wifi-powersave-off /usr/bin/omarchy-wifi-powersave off"
|
|
||||||
@@ -0,0 +1,19 @@
|
|||||||
|
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
|
||||||
Reference in New Issue
Block a user