From 1d7b06d16385bdf469f56de474d36fc99e33f8a1 Mon Sep 17 00:00:00 2001 From: Ryan Yin Date: Thu, 5 Nov 2026 22:10:40 +0800 Subject: [PATCH] fix(ai): restart the OpenRGB server on resume Assisted-by: DeepSeek Harness (deepseek-flash) --- hosts/idols-ai/openrgb/default.nix | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/hosts/idols-ai/openrgb/default.nix b/hosts/idols-ai/openrgb/default.nix index 62cc504b..7905faac 100644 --- a/hosts/idols-ai/openrgb/default.nix +++ b/hosts/idols-ai/openrgb/default.nix @@ -18,15 +18,17 @@ in ${pkgs.coreutils}/bin/install -Dm0644 ${offProfile} /var/lib/OpenRGB/profiles/off.json ''; - # The controller drops its LED state on resume without re-enumerating, so no - # udev event fires; reapply the profile through the running server instead. + # The controller drops its LED state on resume without re-enumerating, so the + # running server keeps a stale controller list: loading the profile into it + # reports success but does not bring the LEDs back. Restart the server so it + # re-detects the controllers and reloads the startup profile. systemd.services.openrgb-resume = { - description = "Reapply the OpenRGB profile after resume"; + description = "Restart the OpenRGB server after resume"; after = [ "suspend.target" ]; wantedBy = [ "suspend.target" ]; serviceConfig = { Type = "oneshot"; - ExecStart = "${pkgs.openrgb}/bin/openrgb --profile ${offProfile}"; + ExecStart = "${pkgs.systemd}/bin/systemctl restart openrgb.service"; }; }; }