Hardware/Razer: Difference between revisions

Axka (talk | contribs)
Make code blocks use File template
DHCP (talk | contribs)
m style fixes
 
(One intermediate revision by one other user not shown)
Line 5: Line 5:
OpenRazer is an open-source project to support Razer peripherals, including those found in their laptops. To enable the OpenRazer you need to add the following to your system configuration:
OpenRazer is an open-source project to support Razer peripherals, including those found in their laptops. To enable the OpenRazer you need to add the following to your system configuration:


{{file|/etc/nixos/configuration.nix|nix|<nowiki>
<syntaxHighlight lang=nix>
hardware.openrazer.enable = true;
hardware.openrazer.enable = true;
environment.systemPackages = with pkgs; [
environment.systemPackages = with pkgs; [
   openrazer-daemon
   openrazer-daemon
];
];
</nowiki>}}
</syntaxHighlight>


To run the <code>openrazer-daemon</code>, you need to be in the <code>openrazer</code> group.
To run the <code>openrazer-daemon</code>, you need to be in the <code>openrazer</code> group.


{{file|/etc/nixos/configuration.nix|nix|<nowiki>
<syntaxHighlight lang=nix>
users.users.<username>.extraGroups = [ "openrazer" ];
users.users.<username>.extraGroups = [ "openrazer" ];
</nowiki>}}
</syntaxHighlight>


To enable a front-end to control the peripherals, add the following to your system configuration:
To enable a front-end to control the peripherals, add the following to your system configuration:


{{file|/etc/nixos/configuration.nix|nix|<nowiki>
<syntaxHighlight lang=nix>
environment.systemPackages = with pkgs; [
environment.systemPackages = with pkgs; [
   polychromatic
   polychromatic
];
];
</nowiki>}}
</syntaxHighlight>


== Razer Blade 15 Advanced (Early 2020 model) ==
== Razer Blade 15 Advanced (Early 2020 model) ==
Line 32: Line 32:
Upon closing the lid to the laptop and reopening, an issue occurs where the device will intermittently go back into hybernate mode after around 10-30 seconds. Setting the kernel parameter <code>button.lid_init_state=open</code> fixes this issue. The following is an example configuration (working in NixOS 22.05):
Upon closing the lid to the laptop and reopening, an issue occurs where the device will intermittently go back into hybernate mode after around 10-30 seconds. Setting the kernel parameter <code>button.lid_init_state=open</code> fixes this issue. The following is an example configuration (working in NixOS 22.05):


{{file|/etc/nixos/configuration.nix|nix|<nowiki>
<syntaxHighlight lang=nix>
boot.kernelParams = [ "button.lid_init_state=open" ];
boot.kernelParams = [ "button.lid_init_state=open" ];
</nowiki>}}
</syntaxHighlight>


=== Getting the Nvidia card to work properly with external displays ===
=== Getting the Nvidia card to work properly with external displays ===
Line 42: Line 42:
After setting the GPU MODE to "Dedicated GPU only" in the BIOS, enabling [[NVIDIA#Sync mode]] is necessary in order for both the laptop's display and external display/ports to work properly. Here is an example configuration snippet for NixOS 22.05:
After setting the GPU MODE to "Dedicated GPU only" in the BIOS, enabling [[NVIDIA#Sync mode]] is necessary in order for both the laptop's display and external display/ports to work properly. Here is an example configuration snippet for NixOS 22.05:


{{file|/etc/nixos/configuration.nix|nix|<nowiki>
<syntaxHighlight lang=nix>
services.xserver.videoDrivers = [ "nvidia" ];
services.xserver.videoDrivers = [ "nvidia" ];
hardware.opengl.enable = true;
hardware.opengl.enable = true;
Line 56: Line 56:
   };
   };
};
};
</nowiki>}}
</syntaxHighlight>
 


=== Additional Resources ===
=== Additional Resources ===
Line 66: Line 65:


https://wiki.archlinux.org/title/Razer_Blade
https://wiki.archlinux.org/title/Razer_Blade


== Updating your system to use the unstable drivers and daemon ==
== Updating your system to use the unstable drivers and daemon ==
Line 73: Line 71:


Add the below to your system configuration:
Add the below to your system configuration:
{{file|/etc/nixos/configuration.nix|nix|<nowiki>
<syntaxHighlight lang=nix>
nixpkgs.config = {
nixpkgs.config = {
   allowUnfree = true;
   allowUnfree = true;
Line 95: Line 93:
environment.systemPackages = with pkgs; [
environment.systemPackages = with pkgs; [
   unstable.polychromatic
   unstable.polychromatic
# alternatively
  # alternatively:
# unstable.razergenie
  # unstable.razergenie
];
];
</nowiki>}}
</syntaxHighlight>


== USB disable Issues ==
== USB disable Issues ==
If you are encountering issues that your Razer keyboard does light up on boot shortly and then can not be found by the open-razer-daemon until you unplug your USB cable and re-plug it. Then you might want to reset your USB on startup so that after login the daemon finds it again.
If you are encountering issues that your Razer keyboard does light up on boot shortly and then can not be found by the open-razer-daemon until you unplug your USB cable and re-plug it. Then you might want to reset your USB on startup so that after login the daemon finds it again.


{{file|/etc/nixos/configuration.nix|nix|<nowiki>
<syntaxHighlight lang=nix>
# Razer usb reset. Since it disables somehow on boot.
# Razer usb reset. Since it disables somehow on boot.
systemd.services."usb-reset" = {
systemd.services."usb-reset" = {
Line 122: Line 120:
   wantedBy = [ "graphical.target" ];
   wantedBy = [ "graphical.target" ];
};
};
</nowiki>}}
</syntaxHighlight>


The text <code>7-3</code> is composed of the bus number (7) and the port (device?) number (3).
The text <code>7-3</code> is composed of the bus number (7) and the port (device?) number (3).
Line 130: Line 129:
If that does not work, you can reset all USB controllers instead <ref>https://unix.stackexchange.com/questions/704341/how-to-reset-usb-controllers</ref>:
If that does not work, you can reset all USB controllers instead <ref>https://unix.stackexchange.com/questions/704341/how-to-reset-usb-controllers</ref>:


{{file|/etc/nixos/configuration.nix|nix|<nowiki>
<syntaxHighlight lang=nix>
# Razer usb reset. Since it disables somehow on boot.
# Razer usb reset. Since it disables somehow on boot.
systemd.services."usb-reset" = {
systemd.services."usb-reset" = {
Line 175: Line 174:
   wantedBy = [ "graphical.target" ];
   wantedBy = [ "graphical.target" ];
};
};
</nowiki>}}
</syntaxHighlight>


== References ==
== References ==