Skip to content

Instantly share code, notes, and snippets.

@BernardoGO
Created March 20, 2016 08:04
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/f459d528a2280fded3b2 to your computer and use it in GitHub Desktop.
Save BernardoGO/f459d528a2280fded3b2 to your computer and use it in GitHub Desktop.
#! /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)
tee /proc/acpi/bbswitch <<<ON
modprobe -r nouveau
#tee /proc/acpi/bbswitch <<<OFF
#echo "bbb" > /home/bernardo/resume.txt
#systemctl stop bumblebeed
modprobe -r bbswitch
modprobe -r nvidia
;;
resume|thaw)
modprobe nouveau
modprobe -r nouveau
modprobe nvidia
systemctl start bumblebeed
modprobe nvidia
tee /proc/acpi/bbswitch <<<OFF
modprobe nvidia
modprobe bbswitch
modprobe nvidia
cp /home/bernardo/trnoff /etc/pm/sleep.d/66nvidia
:
;;
esac
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment