Skip to content

Instantly share code, notes, and snippets.

@djhworld
Created June 7, 2020 09:38
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save djhworld/734fd6fc36768ecff639cd2d6c656f5a to your computer and use it in GitHub Desktop.
Save djhworld/734fd6fc36768ecff639cd2d6c656f5a to your computer and use it in GitHub Desktop.
#!/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
[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