My udev rule is not working. I've added information about the udev rule:
udev rule:
$ cat /lib/udev/rules.d/95-monitor.rules
KERNEL=="card0", SUBSYSTEM=="drm", RUN+="/bin/bash /home/koko/Desktop/monitor.sh"
executed:
sudo udevadm control --reload
sudo udevadm trigger
monitor.sh
#!/bin/bash
notify-send "Monitor Connected."
Udev is running:
$ service --status-all
..
[ + ] udev
..
udev info
$ sudo udevadm info -a -p /devices/pci00:00/0000:00:02.0/drm/card0
Udevadm info starts with the device specified by the devpath and then
walks up the chain of parent devices. It prints for every device
found, all possible attributes in the udev rules key format.
A rule to match, can be composed by the attributes of the device
and the attributes from one single parent device.
looking at device '/devices/pci0000:00/0000:00:02.0/drm/card0':
KERNEL=="card0"
SUBSYSTEM=="drm"
DRIVER==""
ATTR{error}=="no error state collected"
looking at parent device '/devices/pci0000:00/0000:00:02.0':
KERNELS=="0000:00:02.0"
SUBSYSTEMS=="pci"
DRIVERS=="i915"
ATTRS{boot_vga}=="1"
ATTRS{broken_parity_status}=="0"
ATTRS{class}=="0x030000"
ATTRS{consistent_dma_mask_bits}=="36"
ATTRS{d3cold_allowed}=="1"
ATTRS{device}=="0x0046"
ATTRS{dma_mask_bits}=="36"
ATTRS{driver_override}=="(null)"
ATTRS{enable}=="1"
ATTRS{irq}=="26"
ATTRS{local_cpulist}=="0-3"
ATTRS{local_cpus}=="0f"
ATTRS{msi_bus}=="1"
ATTRS{numa_node}=="-1"
ATTRS{subsystem_device}=="0x0410"
ATTRS{subsystem_vendor}=="0x1028"
ATTRS{vendor}=="0x8086"
looking at parent device '/devices/pci0000:00':
KERNELS=="pci0000:00"
SUBSYSTEMS==""
DRIVERS==""
udevadm monitor:
$ sudo udevadm monitor --environment --udev
monitor will print the received events for:
UDEV - the event which udev sends out after rule processing
UDEV [26447.971745] 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
ID_FOR_SEAT=drm-pci-0000_00_02_0
ID_PATH=pci-0000:00:02.0
ID_PATH_TAG=pci-0000_00_02_0
MAJOR=226
MINOR=0
SEQNUM=3035
SUBSYSTEM=drm
TAGS=:uaccess:master-of-seat:seat:
USEC_INITIALIZED=21623159