OpenRGB: Difference between revisions

From NixOS Wiki
imported from old wiki
openrgb: add hardware category
 
(One intermediate revision by one other user not shown)
Line 1: Line 1:
[https://openrgb.org/ OpenRGB] is a powerful open-source software for controlling RGB lighting on various computer components and peripherals. It provides a unified interface for managing RGB devices from different manufacturers, eliminating the need for multiple proprietary software solutions. With OpenRGB, users can <strong>customize</strong> their PC's lighting effects, <strong>synchronize</strong> colors across devices, and create <strong>dynamic</strong> lighting profiles. This tool is particularly useful for users who want to maintain full control over their system's RGB lighting without relying on closed-source applications.
== Installation ==
== Installation ==
<div style="border: 1px solid #D33; background: #FFEBEB; padding: 30px; border-radius: 5px; margin: 10px 0px; display: flex; align-items: center;">
    <div style="color: #D33; font-size: 40px; margin-right: 15px; background: #FFEBEB; display: flex; line-height: 0;  align-items: center;">⚠</div>
    <div style="color: #D33; font-size: 15px; font-style: normal; font-weight: 400; line-height: normal; text-align: left;">Please do note that installing this package by itself will lead to udev rules not being set up correctly. It is recommended to have both services.hardware.openrgb.enable = true; and the package installed (either openrgb or openrgb-with-all-plugins)</div>
</div>


add to <code>/etc/nixos/configuration.nix</code>:
==== Using nix-shell ====
<syntaxhighlight lang="nix">
<syntaxhighlight lang="bash" start="3">
services.hardware.openrgb.enable = true;
nix-shell -p openrgb
</syntaxhighlight>
</syntaxhighlight>
No need to add OpenRGB to systemPackages.


Please do note that installing this package by itself will lead to <code>udev</code> rules not being set up correctly. It is recommended to have both <code>services.hardware.openrgb.enable = true;</code> and the package installed.
==== Using Global Configuration ====
<syntaxhighlight lang="text">
environment.systemPackages = [
  pkgs.openrgb
];
</syntaxhighlight>After modifying your configuration, apply the changes by running:<syntaxhighlight lang="bash">
sudo nixos-rebuild switch
</syntaxhighlight>


== Plugins ==
==== Using Home Configuration ====
<syntaxhighlight lang="text">
home.packages = [
  pkgs.openrgb
];
</syntaxhighlight>After updating your configuration, apply the changes by running:<syntaxhighlight lang="bash">
home-manager switch
</syntaxhighlight>


Currently there is no functioning option to install individual plugins, but there is a way to install all of them.
== Configuration ==
==== Basic ====
<syntaxhighlight lang="nix">
services.hardware.openrgb.enable = true;
</syntaxhighlight>


Add this systemPackage to <code>/etc/nixos/configuration.nix</code>:
==== Advanced ====
<syntaxhighlight lang="nix">
<syntaxhighlight lang="nix">
environment.systemPackages = with pkgs; [ openrgb-with-all-plugins ];
services.hardware.openrgb = {
  enable = true;
  package = pkgs.openrgb-with-all-plugins;
  motherboard = "amd";
  server = {
    port = 6742;
    autoStart = true;
  };
};  
</syntaxhighlight>
</syntaxhighlight>


{{warning|1=Please do note that installing this package by itself will lead to <code>udev</code> rules not being set up correctly. It is recommended to have both <code>services.hardware.openrgb.enable = true;</code> and the package installed.}}
== Tips and Tricks ==
==== Location of Options ====
The global options are listed on [https://mynixos.com/search?q=openrgb MyNixOS].  


== Turn off RGB ==
==== Turn off RGB ====


If you'd like to turn off all RGB devices supported by OpenRGB, consider something like:
If you'd like to turn off all RGB devices supported by OpenRGB, consider something like:
Line 52: Line 85:
}
}
</syntaxhighlight>
</syntaxhighlight>
== Troubleshooting ==
== References ==
* https://openrgb.org/
* https://mynixos.com/search?q=openrgb
[[Category:Hardware]]

Latest revision as of 06:51, 9 July 2024

OpenRGB is a powerful open-source software for controlling RGB lighting on various computer components and peripherals. It provides a unified interface for managing RGB devices from different manufacturers, eliminating the need for multiple proprietary software solutions. With OpenRGB, users can customize their PC's lighting effects, synchronize colors across devices, and create dynamic lighting profiles. This tool is particularly useful for users who want to maintain full control over their system's RGB lighting without relying on closed-source applications.

Installation

Please do note that installing this package by itself will lead to udev rules not being set up correctly. It is recommended to have both services.hardware.openrgb.enable = true; and the package installed (either openrgb or openrgb-with-all-plugins)

Using nix-shell

nix-shell -p openrgb

Using Global Configuration

environment.systemPackages = [
  pkgs.openrgb
];

After modifying your configuration, apply the changes by running:

sudo nixos-rebuild switch

Using Home Configuration

home.packages = [ 
  pkgs.openrgb 
];

After updating your configuration, apply the changes by running:

home-manager switch

Configuration

Basic

services.hardware.openrgb.enable = true;

Advanced

services.hardware.openrgb = { 
  enable = true; 
  package = pkgs.openrgb-with-all-plugins; 
  motherboard = "amd"; 
  server = { 
    port = 6742; 
    autoStart = true; 
  }; 
};

Tips and Tricks

Location of Options

The global options are listed on MyNixOS.

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" ];
    };
  };
}

Troubleshooting

References