Load Notification

nxdefiant edited this page Jun 29, 2012 · 2 revisions

Notifications

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.

The rule:

# /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
You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.
Press h to open a hovercard with more details.