Hi,
I wrote a little script to switch the audio over to HDMI and back to speakers, and I would like it to execute when an HDMI cable is plugged in/ unplugged. After HOURS of researching I think I have found out that I need to use a udev rule. I have never done this before, and it isn't working.
First, I did udevadm monitor --env to see if the kernel detects the HDMI cord...this is what I get for both plugging in and unplugging:
KERNEL[19283.520244] change /devices/pci0000:00/0000:00:02.0/drm/card0 (drm)
ACTION=change
DEVNAME=dri/card0
DEVPATH=/devices/pci0000:00/0000:00:02.0/drm/card0
DEVTYPE=drm_minor
HOTPLUG=1
MAJOR=226
MINOR=0
SEQNUM=3518
SUBSYSTEM=drm
UDEV_LOG=3
UDEV [19283.542654] change /devices/pci0000:00/0000:00:02.0/drm/card0 (drm)
ACTION=change
DEVNAME=/dev/dri/card0
DEVPATH=/devices/pci0000:00/0000:00:02.0/drm/card0
DEVTYPE=drm_minor
HOTPLUG=1
MAJOR=226
MINOR=0
SEQNUM=3518
SUBSYSTEM=drm
TAGS=:udev-acl:
UDEV_LOG=3
USEC_INITIALIZED=22622756
Ok, great. So now to create a udev rule:
sudo vim /etc/udev/rules.d/10-local.rules
KERNEL=="card0", ACTION=="change", RUN+="/home/username/Scripts/SwitchHDMIAudio.sh"
Now, from what I have read, this SHOULD work...but it doesn't. I've tried restarting the udev service and reloading the rules to no avail...any help?

