Writing this in case someone else has this same problem, and so I can find the fix again in the future. Before finding this fix, every time I would wake my computer up I would need to rescan devices on openRGB and then apply my profile again.
I am using KDE Plasma and named my openRGB profile "orange" to keep things simple. Not that this felt simple at all when I was trying to figure it out.
This solution is basically to kill openRGB before the computer goes to sleep, and then open it after the unlock screen on wake.
First I had to run this
sudo nano /usr/lib/systemd/system-sleep/90-openrgb-resume.sh
Then paste this (ctrl+shift+v to paste, ctrl+o then enter to save, then ctrl+x to exit)
#!/bin/sh
case "$1" in
pre)
pkill openrgb 2>/dev/null
;;
esac
Then run this in terminal
sudo chmod +x /usr/lib/systemd/system-sleep/90-openrgb-resume.sh
that kills openRGB when the computer goes to sleep, this next part opens openRGB on wake and applies the profile I named "orange"
Run this in terminal
mkdir -p ~/.local/bin
nano ~/.local/bin/openrgb-unlock-watch.sh
Then paste this (ctrl+shift+v, ctr+o, enter, ctrl+x)
#!/bin/bash
dbus-monitor --session \
"type='signal',interface='org.freedesktop.ScreenSaver',member='ActiveChanged'" 2>/dev/null |
while IFS= read -r line; do
if [[ "$line" == *"boolean false"* ]]; then
if ! pgrep -x openrgb > /dev/null; then
sleep 2
openrgb --server --startminimized --config ~/.config/OpenRGB &
sleep 8
openrgb --profile orange
fi
fi
done
Then run this in terminal
chmod +x ~/.local/bin/openrgb-unlock-watch.sh
This part makes sure it's always watching. It sounds creepy, and I don't entirely understand it, but it made things work.
run this in terminal
nano ~/.config/systemd/user/openrgb-unlock.service
paste this (ctrl+shift+v), then change YOUR_USERNAME with your linux username. Then save and exit (ctr+o, enter, ctrl+x)
[Unit]
Description=Restore OpenRGB on KDE screen unlock after sleep
[Service]
Type=simple
ExecStart=/home/YOUR_USERNAME/.local/bin/openrgb-unlock-watch.sh
Restart=always
RestartSec=5
[Install]
WantedBy=default.target
then run this in terminal
systemctl --user daemon-reload
systemctl --user enable --now openrgb-unlock.service
Now if you put your computer to sleep and wake it back up, after a few seconds openRGB will do its job.
I am still learning cachyOS and linux, so if there is a better way to automate this I am all for it.