Skip to content

Instantly share code, notes, and snippets.

@BernardoGO
Last active March 20, 2016 00:15
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save BernardoGO/8bc84d95fe64b7de76f6 to your computer and use it in GitHub Desktop.
Save BernardoGO/8bc84d95fe64b7de76f6 to your computer and use it in GitHub Desktop.
Bash script used to fix suspend/resume on clevo computers that drains a lot of power while sleeping
#! /bin/sh
GPUDRIVER=nvidia
#if [ ! -x /sys/bus/usb/devices/${BUS}-${DEVICE}/power/level ]; then
# exit 0
#fi
case "$1" in
suspend|suspend_hybrid|hibernate)
echo "bbb" > /home/bernardo/resume.txt
service bumblebeed stop
modprobe -r bbswitch
modprobe -r ${GPUDRIVER}
;;
resume|thaw)
modprobe bbswitch
service bumblebeed start
modprobe nvidia
tee /proc/acpi/bbswitch <<<OFF
:
;;
esac
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment