Skip to content

Instantly share code, notes, and snippets.

@RobCranfill
Last active July 10, 2025 17:11
Show Gist options
  • Save RobCranfill/3e54684913402f12e25117b29b81a4d7 to your computer and use it in GitHub Desktop.
Save RobCranfill/3e54684913402f12e25117b29b81a4d7 to your computer and use it in GitHub Desktop.
Fix for Gigabyte Linux suspend bug - from DAK404
#!/bin/bash
############################################################
# Sleep/Wakeup Fix For Gigabyte Motherboards
#
# ----------------------------------------------------------
# ATTENTION!
# This script can be run in a single line from your shell!
# Simply run the following in the Terminal:
#
# sudo bash -c "$(curl -fsSL https://raw.githubusercontent.com/DAK404/OpenSUSE-Setup-Scripts/main/GigabyteDesktop_Sleep_Fix.sh)"
#
# ----------------------------------------------------------
#
# --- CHANGELOG ---
#
# 1.0 (19-July-2024):
# * Bump version to 1.0
############################################################
sudo cat > /etc/systemd/system/biosWakeupWorkaround.service << EOL
[Unit]
Description=Workaround for Gigabyte BIOS sleep/wakeup bug
[Service]
Type=oneshot
ExecStart = /bin/sh -c 'if grep 'GPP0' /proc/acpi/wakeup | grep -q 'enabled'; then echo 'GPP0' > /proc/acpi/wakeup; fi'
[Install]
WantedBy = multi-user.target
EOL
sudo systemctl daemon-reload && sudo systemctl enable biosWakeupWorkaround.service
@DAK404
Copy link

DAK404 commented Jul 10, 2025

For the systems which the workaround specified above does not work, please check the below code for the same (mainly for the A520 boards).

#!/bin/bash

############################################################
# Sleep/Wakeup Fix For Gigabyte Motherboards
# Script forked from DAK404's repo
# Modified for Gigabyte A520i AC by PercyPanleo
#
# ----------------------------------------------------------
# ATTENTION!
# This script can be run in a single line from your shell!
# Simply run the following in the Terminal:
#
#   sudo bash -c "$(curl -fsSL https://raw.githubusercontent.com/PercyPanleo/OpenSUSE-Setup-Scripts/main/GigabyteDesktop_Sleep_Fix.sh)"
#
# ----------------------------------------------------------
#
# --- CHANGELOG ---
#
# 1.0 (19-July-2024):
#    * Bump version to 1.0
# 1.0.1 (22-April-2025):
#    * Forked from DAK404
#    * Replaced GPP0 with GPP8 for certain Gigabyte motherboards
############################################################

sudo cat > /etc/systemd/system/biosWakeupWorkaround.service << EOL
[Unit]
Description=Workaround for Gigabyte BIOS sleep/wakeup bug

[Service]
Type=oneshot
ExecStart = /bin/sh -c 'if grep 'GPP8' /proc/acpi/wakeup | grep -q 'enabled'; then echo 'GPP8' > /proc/acpi/wakeup; fi'

[Install]
WantedBy = multi-user.target
EOL

sudo systemctl daemon-reload && sudo systemctl enable biosWakeupWorkaround.service

All credits to Percy Panleo for this!

https://github.com/PercyPanleo/OpenSUSE-Setup-Scripts/blob/main/GigabyteDesktop_Sleep_Fix.sh

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment