MSI GS65 WiFi Sleep Fix

My friend OrionTheArcher has an MSI GS65.

The MSI GS65 has a long standing issue with the WiFi card is hardware locked upon entering s3. (see)

On Arch Wikipedia Talk, User “Idioticacid” writes about his fix.

This would be an awesome fix to implement, if only we were not using Bazzite OS.

So we had to get creative.

Solution

Write the following content to /etc/systemd/system/msi-gs65.service:

[Unit]
#After=sleep.target
After=systemd-suspend.service systemd-hybrid-sleep.service systemd-hibernate.service

[Service]
Type=oneshot
# Load module
ExecStartPre=modprobe ec_sys write_support=1
# Restore radio kill switch
ExecStart=isw -s 0x34 48
# Toggle radio device on
ExecStart=isw -s 0x2e 9
# Unload module
ExecStartPost=modprobe --remove ec_sys

[Install]
WantedBy=multi-user.target sleep.target

Afterwards, run sudo systemctl daemon-reload and then sudo systemctl enable msi-gs65.

Now when you sleep and wake your laptop, your wifi should automatically be fixed.