Hello,
I’ve been trying to create a udev rule that triggers when i plug or unplug an HDMI monitor; I tried looking at udevadm monitor output to figure out the characteristics of the udev event that should trigger when I plug/unplug the HDMI cable, but had no output, which seemed strange.
I tried the same command on a Linux Mint live-USB that I had lying around, and this time got events for plugging in and out, so it doesn’t seem to be an issue with my hardware.
This is my system info:
$ inxi -Fxxxz
System:
Kernel: 6.0.15-1-MANJARO arch: x86_64 bits: 64 compiler: gcc v: 12.2.0
Desktop: Xfce v: 4.18.0 tk: Gtk v: 3.24.35 info: xfce4-panel wm: xfwm
v: 4.18.0 vt: 7 dm: LightDM v: 1.32.0 Distro: Manjaro Linux
base: Arch Linux
Machine:
Type: Laptop System: HP product: Victus by HP Gaming Laptop 15-fa0xxx v: N/A
serial: <filter> Chassis: type: 10 serial: <filter>
Mobo: HP model: 8A50 v: 37.43 serial: <filter> UEFI: AMI v: F.10
date: 08/23/2022
Battery:
ID-1: BAT0 charge: 36.0 Wh (69.8%) condition: 51.6/52.6 Wh (98.2%)
volts: 11.7 min: 11.6 model: HP Primary type: Li-ion serial: <filter>
status: discharging cycles: 10
CPU:
Info: 8-core (4-mt/4-st) model: 12th Gen Intel Core i5-12450H bits: 64
type: MST AMCP smt: enabled arch: Alder Lake rev: 3 cache: L1: 704 KiB
L2: 7 MiB L3: 12 MiB
Speed (MHz): avg: 2500 min/max: 400/4400:3300 volts: 1.2 V
ext-clock: 100 MHz cores: 1: 2500 2: 2500 3: 2500 4: 2500 5: 2500 6: 2500
7: 2500 8: 2500 9: 2500 10: 2500 11: 2500 12: 2500 bogomips: 59916
Flags: avx avx2 ht lm nx pae sse sse2 sse3 sse4_1 sse4_2 ssse3 vmx
Graphics:
Device-1: Intel Alder Lake-P GT1 [UHD Graphics] vendor: Hewlett-Packard
driver: i915 v: kernel arch: Gen-12.2 ports: active: eDP-1
empty: DP-1, DP-2, DP-3, DP-4 bus-ID: 00:02.0 chip-ID: 8086:46a3
class-ID: 0300
Device-2: NVIDIA TU117M [GeForce GTX 1650 Mobile / Max-Q]
vendor: Hewlett-Packard driver: nvidia v: 525.60.11 arch: Turing pcie:
speed: 2.5 GT/s lanes: 8 bus-ID: 01:00.0 chip-ID: 10de:1f9d class-ID: 0300
Device-3: Chicony HP Wide Vision HD Camera type: USB driver: uvcvideo
bus-ID: 3-6:2 chip-ID: 04f2:b766 class-ID: 0e02 serial: <filter>
Display: x11 server: X.Org v: 21.1.6 compositor: xfwm v: 4.18.0 driver: X:
loaded: modesetting,nvidia alternate: fbdev,nouveau,nv,vesa dri: iris
gpu: i915 display-ID: :0.0 screens: 1
Screen-1: 0 s-res: 1920x1080 s-dpi: 96 s-size: 508x285mm (20.00x11.22")
s-diag: 582mm (22.93")
Monitor-1: eDP-1 model: ChiMei InnoLux 0x1521 res: 1920x1080 hz: 144
dpi: 142 size: 344x193mm (13.54x7.6") diag: 394mm (15.5") modes: 1920x1080
API: OpenGL v: 4.6 Mesa 22.3.1 renderer: Mesa Intel Graphics (ADL GT2)
direct render: Yes
Audio:
Device-1: Intel Alder Lake PCH-P High Definition Audio
vendor: Hewlett-Packard driver: sof-audio-pci-intel-tgl bus-ID: 00:1f.3
chip-ID: 8086:51c8 class-ID: 0401
Device-2: NVIDIA vendor: Hewlett-Packard driver: snd_hda_intel v: kernel
pcie: speed: 2.5 GT/s lanes: 8 bus-ID: 01:00.1 chip-ID: 10de:10fa
class-ID: 0403
Sound API: ALSA v: k6.0.15-1-MANJARO running: yes
Sound Server-1: JACK v: 1.9.21 running: no
Sound Server-2: PulseAudio v: 16.1 running: yes
Sound Server-3: PipeWire v: 0.3.63 running: yes
Network:
Device-1: MEDIATEK MT7921 802.11ax PCI Express Wireless Network Adapter
vendor: AzureWave driver: mt7921e v: kernel pcie: speed: 5 GT/s lanes: 1
bus-ID: 04:00.0 chip-ID: 14c3:7961 class-ID: 0280
IF: wlp4s0 state: up mac: <filter>
Device-2: Realtek RTL8111/8168/8411 PCI Express Gigabit Ethernet
vendor: Hewlett-Packard driver: r8169 v: kernel pcie: speed: 2.5 GT/s
lanes: 1 port: 3000 bus-ID: 05:00.0 chip-ID: 10ec:8168 class-ID: 0200
IF: eno1 state: down mac: <filter>
Bluetooth:
Device-1: IMC Networks Wireless_Device type: USB driver: btusb v: 0.8
bus-ID: 3-7:3 chip-ID: 13d3:3567 class-ID: e001 serial: <filter>
Report: bt-adapter ID: hci0 rfk-id: 0 state: up address: <filter>
Drives:
Local Storage: total: 476.94 GiB used: 368.77 GiB (77.3%)
ID-1: /dev/nvme0n1 vendor: Micron model: MTFDKBA512TFH-1BC1AABHA
size: 476.94 GiB speed: 63.2 Gb/s lanes: 4 type: SSD serial: <filter>
rev: HPS0043 temp: 35.9 C scheme: GPT
Partition:
ID-1: / size: 467.89 GiB used: 368.77 GiB (78.8%) fs: ext4
dev: /dev/nvme0n1p6
ID-2: /boot/efi size: 509 MiB used: 316 KiB (0.1%) fs: vfat
dev: /dev/nvme0n1p5
Swap:
Alert: No swap data was found.
Sensors:
System Temperatures: cpu: 31.0 C mobo: N/A
Fan Speeds (RPM): cpu: 2209 fan-2: 1996
Info:
Processes: 264 Uptime: 1h 9m wakeups: 7387 Memory: 15.3 GiB
used: 2.51 GiB (16.4%) Init: systemd v: 252 default: graphical Compilers:
gcc: 12.2.0 clang: 14.0.6 Packages: 1250 pm: pacman pkgs: 1235 pm: flatpak
pkgs: 15 Shell: Bash (su) v: 5.1.16 running-in: xfce4-terminal inxi: 3.3.24
$ mhwd -li
> Installed PCI configs:
--------------------------------------------------------------------------------
NAME VERSION FREEDRIVER TYPE
--------------------------------------------------------------------------------
video-hybrid-intel-nvidia-prime 2021.11.04 false PCI
video-modesetting 2020.01.13 true PCI
Warning: No installed USB configs!
My problem is very similar to the one found on this forum post Plug/unplug event for external monitor is not detected by udev
Is there maybe a program different to udev that could be used to listen in on these events, and execute a command accordingly; or a config file that could be causing this issue?
Thanks