Created
June 7, 2020 09:38
-
-
Save djhworld/734fd6fc36768ecff639cd2d6c656f5a to your computer and use it in GitHub Desktop.
Fix macbook suspend issue on Linux https://joshtronic.com/2017/03/13/getting-suspend-in-linux-working-on-a-macbook-pro/
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# could probably get this to work with GNU grep but using ripgrep for now | |
check=$(cat /proc/acpi/wakeup | /usr/bin/rg XHC1 | /usr/bin/rg disabled) | |
if [[ $check == '' ]]; then | |
echo "Wakeup from XHC1 is enabled - disabling!" | |
echo XHC1 > /proc/acpi/wakeup | |
else | |
echo "Wakeup from XHC1 is disabled - doing nothing!" | |
fi | |
exit 0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[Unit] | |
Description=FixMacbookSuspend | |
[Service] | |
Type=oneshot | |
ExecStart=/bin/bash /home/danielharper/bin/fix-suspend.sh | |
[Install] | |
WantedBy=multi-user.target |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment