@Jencen
It's a few pieces working together.
The udev rule watches for the eGPU on the PCIe bus and triggers a systemd service. The service loads i2c-dev, waits for the GPU to fully initialize, then runs OpenRGB AppImage with --noautoconnect -d 0 --mode static --color 000044. There's also a matching sleep hook in /etc/systemd/system-sleep/ that does the same on wake, since the GPU resets its RGB every time it loses power. (Mine is just continually powered on, but this is a just-in-case thing)
The udev rule (appended to whatever rules file you're already using for the GPU):
ACTION=="add", SUBSYSTEM=="pci", ATTR{vendor}=="0x1002", ATTR{device}=="0x7550", TAG+="systemd", ENV{SYSTEMD_WANTS}+="egpu-rgb.service"
The service at /etc/systemd/system/egpu-rgb.service:
[Unit]
Description=Set eGPU RGB to dark blue
After=multi-user.target
[Service]
Type=oneshot
WorkingDirectory=/tmp
ExecStartPre=/sbin/modprobe i2c-dev
ExecStartPre=/bin/sleep 20
ExecStart=/usr/local/bin/OpenRGB.AppImage --noautoconnect -d 0 --mode static --color 000044
RemainAfterExit=yes
The sleep hook at /etc/systemd/system-sleep/egpu-rgb-wake.sh:
#!/bin/sh
case $1 in
post)
if lspci -d 1002:7550 | grep -q .; then
/sbin/modprobe i2c-dev && sleep 5 && cd /tmp && /usr/local/bin/OpenRGB.AppImage --noautoconnect -d 0 --mode static --color 000044
fi
;;
esac
Couple of gotchas to be aware of: OpenRGB AppImage crashes if it can't write to ./logs (this is Bazzite), so WorkingDirectory=/tmp is important. The sleep in the service gives the eGPU time to come up on i2c before OpenRGB tries to talk to it. And the lspci check in the wake hook means it won't error out if you're running undocked with a device like mine.
Swap the vendor/device IDs and the color for your card and you're set.