#!/bin/bash # This script should contain the command(s) nessesary to switch on the # nVidia card. # # ---------------------------------------------------------------------------- # "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 ENABLE_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 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 "Enabling nVidia Card failed ($result)." notify-send -t 5000 --icon="/home/$USER/.local/share/icons/hardware_down.png" \ "Enabling nVIDIA failed ($result)!" ;; *) echo "Enabling nVidia Card Succeded." notify-send -t 5000 --icon="/home/$USER/.local/share/icons/hardware_down.png" \ "nVIDIA enabled succesfully" ;; esac } echo $(acpi_call "\_SB.PCI0.P0P2.PEGP._ON") #power-on modprobe nvidia-current