Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
I had the trouble, that viewing flash video sometimes enables my nvidia card. So I wrote a quick udev rule that sends me a notification when the nvidia module gets loaded.
# /etc/udev/rules.d/99_bumblebee.rules DEVPATH=="/module/nvidia", ACTION=="add", RUN+="/usr/local/sbin/nvidia_event.sh on" DEVPATH=="/module/nvidia", ACTION=="remove", RUN+="/usr/local/sbin/nvidia_event.sh off"
The file calling notify-send:
#!/bin/sh # /usr/local/sbin/nvidia_event.sh USER=my_username case $1 in on) status="turned on" ;; off) status="turned off" ;; esac su $USER -c "export DISPLAY=:0.0; notify-send nvidia \"$status\"" || exit 0