Skip to content

Instantly share code, notes, and snippets.

@neggles
Last active December 3, 2021 01:15
Show Gist options
  • Save neggles/efea12869bf6b601f8c8c9af03b16c2d to your computer and use it in GitHub Desktop.
Save neggles/efea12869bf6b601f8c8c9af03b16c2d to your computer and use it in GitHub Desktop.
systemd units that disable wifi power saving while started and enable when stopped. single wlan0 version & @interface.service version provided
[Unit]
Description=Disable WiFi power saving.
After=sys-subsystem-net-devices-wlan0.device
PartOf=sys-subsystem-net-devices-wlan0.device
[Service]
Type=oneshot
RemainAfterExit=yes
ExecStart=/sbin/iw dev wlan0 set power_save off
ExecStop=/sbin/iw dev wlan0 set power_save on
[Install]
WantedBy=sys-subsystem-net-devices-wlan0.device
[Unit]
Description=Disable WiFi power saving.
After=sys-subsystem-net-devices-%i.device
PartOf=sys-subsystem-net-devices-%i.device
[Service]
Type=oneshot
RemainAfterExit=yes
ExecStart=/sbin/iw dev %i set power_save off
ExecStop=/sbin/iw dev %i set power_save on
[Install]
WantedBy=sys-subsystem-net-devices-%i.device
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment