You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

29 lines
704 B
Bash

#!/bin/bash
function exit_script {
sleep 0.5
if nvidia-smi | grep "No running processes found"; then
sudo rmmod nvidia_modeset
sudo rmmod nvidia
sudo sh -c 'echo "\\_SB.PCI0.GPP0.PG00._OFF" > /proc/acpi/call'
fi
}
trap exit_script SIGINT
trap exit_script SIGTERM
if lsmod | grep nvidia; then
vblank_mode=0 primusrun "$@"
else
sudo sh -c 'echo "\\_SB.PCI0.GPP0.PG00._ON" > /proc/acpi/call'
sleep 1
vblank_mode=0 primusrun "$@"
fi
exit_script
#sleep 1
#if nvidia-smi | grep "No running processes found"; then
# sudo rmmod nvidia_modeset
# sudo rmmod nvidia
# sudo sh -c 'echo "\\_SB.PCI0.GPP0.PG00._OFF" > /proc/acpi/call'
#fi