diff --git a/system_files/desktop/shared/usr/lib/systemd/system/intel-wifi-disable.service b/system_files/desktop/shared/usr/lib/systemd/system/intel-wifi-disable.service new file mode 100644 index 0000000000..ba0da3cd8c --- /dev/null +++ b/system_files/desktop/shared/usr/lib/systemd/system/intel-wifi-disable.service @@ -0,0 +1,10 @@ +[Unit] +Description=Disable AX1775 Wi-Fi on Sleep +Before=systemd-suspend.service + +[Service] +Type=oneshot +ExecStart=/usr/bin/modprobe -rv iwlmvm iwlmld iwlwifi + +[Install] +WantedBy=system-suspend.service diff --git a/system_files/desktop/shared/usr/lib/systemd/system/intel-wifi-enable.service b/system_files/desktop/shared/usr/lib/systemd/system/intel-wifi-enable.service new file mode 100644 index 0000000000..bdca853f32 --- /dev/null +++ b/system_files/desktop/shared/usr/lib/systemd/system/intel-wifi-enable.service @@ -0,0 +1,14 @@ +[Unit] +Description=Re-enable AX1775 Wi-Fi after Sleep +After=systemd-suspend.service +After=systemd-hibernate.service +After=systemd-suspend-then-hibernate.service + +[Service] +Type=oneshot +ExecStart=/usr/bin/modprobe -a iwlwifi iwlmld iwlmvm + +[Install] +WantedBy=systemd-suspend.service +WantedBy=systemd-hibernate.service +WantedBy=systemd-suspend-then-hibernate.service diff --git a/system_files/desktop/shared/usr/share/ublue-os/just/81-bazzite-fixes.just b/system_files/desktop/shared/usr/share/ublue-os/just/81-bazzite-fixes.just index 38de9ae308..10810eb21e 100644 --- a/system_files/desktop/shared/usr/share/ublue-os/just/81-bazzite-fixes.just +++ b/system_files/desktop/shared/usr/share/ublue-os/just/81-bazzite-fixes.just @@ -2,6 +2,42 @@ alias patch-gmod := fix-gmod +# enable or disable a workaround for Intel Wifi7(802.11be) AX1775*/AX1790*/BE20*/BE401/BE1750* 2x2 +fix-ax1775-sleep: + #!/usr/bin/bash + # Explain the purpose of the script + echo -e "This script works around an issue for Intel Wifi-7 AX1775*/AX1790*/BE20*/BE401/BE1750*" + echo -e "where they fail to start-up after sleep, causing them to stay in D3cold state until reboot.\n" + echo -e "Enabling it will shut down the Wi-Fi module before sleep, and restart it after sleep." + echo -e "Disabling it will bring back the old functionality (for when it gets fixed)" + # Toggle on the service to shut down / restart the Wi-Fi device + enable_fix() { + systemctl enable intel-wifi-disable.service + systemctl enable intel-wifi-enable.service + echo -e "\nEnabled fix, toggle again to disable" + } + # Toggle off the service to shut down / restart the Wi-Fi device + disable_fix() { + systemctl disable intel-wifi-disable.service + systemctl disable intel-wifi-enable.service + echo -e "\nDisabled fix, toggle again to enable" + } + # Check if the file is symlinked (Enabled or Disabled) + EXISTS="$(systemctl is-enabled "intel-wifi-enable.service")" + echo -e "\nCurrent service status: ${EXISTS^}\n" + # Enables or disables depending on the status + case "$EXISTS" in + "enabled") + disable_fix + ;; + "disabled") + enable_fix + ;; + "not-found") + echo -e "Failed to find intel-wifi-enable.service..." + ;; + esac + # Patch GMod's 64-bit beta to work properly on Linux (https://github.com/solsticegamestudios/GModCEFCodecFix) fix-gmod: #!/usr/bin/bash