#!/bin/bash # This script should contain the command(s) nessesary to switch off the # nVidia card. # Examples are available in /usr/share/doc/bumblebee # # ---------------------------------------------------------------------------- # "THE BEER-WARE LICENSE" (Revision 42): # wrote this file. As long as you retain this notice you # can do whatever you want with this stuff. If we meet some day, and you think # this stuff is worth it, you can buy me a beer in return mrs_sheep. # ---------------------------------------------------------------------------- # echo "Running DISABLE_CARD by mrssheep for IRONHIDE by MrMEEE" if [ "$(id -u)" != "0" ] ; then echo "This script must be run as root or via sudo" exit fi #if ! lsmod | grep -q nvidia; then # echo "Skipping: nVidia Card already disabled" # notify-send -t 5000 --icon="/home/$USER/.local/share/icons/hardware_down.png" \ "nVIDIA unchanged. Already disabled!" # exit #fi rmmod nvidia if lsmod | grep -q nvidia; then echo "Error: could not unload nvidia module, leaving card turned on" notify-send -t 5000 --icon="/home/$USER/.local/share/icons/hardware_error.png" \ "nVIDIA unchanged. Couldn't unload nVidia-Module!" exit fi modprobe acpi_call if ! lsmod | grep -q acpi_call; then echo "Error: acpi_call module not loaded" notify-send -t 5000 --icon="/home/$USER/.local/share/icons/hardware_error.png" \ "nVIDIA unchanged. Module acpi_call not loaded!" exit fi acpi_call () { echo "$*" > /proc/acpi/call result=$(cat /proc/acpi/call) case "$result" in Error*) echo "Disabling nVidia Card failed ($result)." ;; *) echo "Disabling nVidia Card Succeded." ;; esac } echo $(acpi_call "\_SB.PCI0.P0P2.PEGP._OFF") #power-off