Untested sketch: Add an udev rule like
ACTION=="add", SUBSYSTEMS=="usb", ENV{ID_VENDOR_ID}=="XXXX", ENV{ID_MODEL_ID}=="YYYY", ENV{SYSTEMD_USER_WANTS}+="hp-firmware.service"
and add a /usr/lib/systemd/user/hp-firmware.service whose ExecStart= calls
/usr/bin/hp-plugin-ubuntu if necessary. Note that you probably need some shell commands there, use
ExecStart=/bin/sh -ec 'shell code here; \
more shell code there'
Untested sketch: Add an udev rule like VENDOR_ ID}=="XXXX" , ENV{ID_ MODEL_ID} =="YYYY" , ENV{SYSTEMD_ USER_WANTS} +="hp-firmware. service"
ACTION=="add", SUBSYSTEMS=="usb", ENV{ID_
and add a /usr/lib/ systemd/ user/hp- firmware. service whose ExecStart= calls hp-plugin- ubuntu if necessary. Note that you probably need some shell commands there, use
/usr/bin/
ExecStart=/bin/sh -ec 'shell code here; \
more shell code there'
for that.