Files
2026-08-25 13:10:50 -07:00

15 lines
613 B
Bash
Executable File

#!/bin/bash
# Re-apply RGB after suspend/resume. Direct-mode Corsair/Aura state is volatile and the USB
# controllers re-enumerate on wake, so restart the OpenRGB server (rgb-lavender.service is
# PartOf it and re-runs automatically). Pure user-level: watches logind's PrepareForSleep.
set -u
exec dbus-monitor --system "type='signal',interface='org.freedesktop.login1.Manager',member='PrepareForSleep'" |
while read -r line; do
case "$line" in
*"boolean false"*)
sleep 3 # let USB finish re-enumerating before re-detecting
systemctl --user restart openrgb-server.service
;;
esac
done