Skip to content

Instantly share code, notes, and snippets.

@MauricePasternak
Created November 27, 2024 00:32
Show Gist options
  • Select an option

  • Save MauricePasternak/603987008f47fa4a0345970240ff9731 to your computer and use it in GitHub Desktop.

Select an option

Save MauricePasternak/603987008f47fa4a0345970240ff9731 to your computer and use it in GitHub Desktop.
Fixes an issue with Gigabyte boards and Ubuntu suspend
#!/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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment