From 840febfc16f8f358b5dbc6da1fb04cc7ec744d85 Mon Sep 17 00:00:00 2001 From: Simon Gardling Date: Wed, 2 Oct 2024 21:33:54 -0400 Subject: [PATCH] update no-rgb service --- etcnixos/system-nixos.nix | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/etcnixos/system-nixos.nix b/etcnixos/system-nixos.nix index 9ba0080..2b477b1 100644 --- a/etcnixos/system-nixos.nix +++ b/etcnixos/system-nixos.nix @@ -67,9 +67,11 @@ let no-rgb = pkgs.writeScriptBin "no-rgb" '' #!/bin/sh - NUM_DEVICES=$(${pkgs.openrgb}/bin/openrgb --noautoconnect --list-devices | grep -E '^[0-9]+: ' | wc -l) + set -e - for i in $(seq 0 $(($NUM_DEVICES - 1))); do + NUM_DEVICES=$(${pkgs.openrgb}/bin/openrgb --noautoconnect --list-devices | ${pkgs.gnugrep}/bin/grep -E '^[0-9]+: ' | ${pkgs.coreutils}/bin/wc -l) + + for i in $(${pkgs.coreutils}/bin/seq 0 $(($NUM_DEVICES - 1))); do ${pkgs.openrgb}/bin/openrgb --noautoconnect --device $i --mode direct --color 000000 done '';