OpenRGB: Difference between revisions
imported>Tom Document how to turn off all RGB using OpenRGB |
imported>Luanrivello m openrgb will give an i2c error and boot slower without this line |
||
Line 18: | Line 18: | ||
services.udev.packages = [ pkgs.openrgb ]; | services.udev.packages = [ pkgs.openrgb ]; | ||
boot.kernelModules = [ "i2c-dev" ]; | boot.kernelModules = [ "i2c-dev" ]; | ||
hardware.i2c.enable = true; | |||
systemd.services.no-rgb = { | systemd.services.no-rgb = { |
Revision as of 12:07, 6 October 2023
Turn off RGB
If you'd like to turn off all RGB devices supported by OpenRGB, consider something like:
{ pkgs, lib, ... }:
let
no-rgb = pkgs.writeScriptBin "no-rgb" ''
#!/bin/sh
NUM_DEVICES=$(${pkgs.openrgb}/bin/openrgb --noautoconnect --list-devices | grep -E '^[0-9]+: ' | wc -l)
for i in $(seq 0 $(($NUM_DEVICES - 1))); do
${pkgs.openrgb}/bin/openrgb --noautoconnect --device $i --mode static --color 000000
done
'';
in {
config = {
services.udev.packages = [ pkgs.openrgb ];
boot.kernelModules = [ "i2c-dev" ];
hardware.i2c.enable = true;
systemd.services.no-rgb = {
description = "no-rgb";
serviceConfig = {
ExecStart = "${no-rgb}/bin/no-rgb";
Type = "oneshot";
};
wantedBy = [ "multi-user.target" ];
};
};
}