OpenRazer on Gentoo Linux
Control Razer RGB devices using native kernel drivers and razer-cli.
Tested with:
- Razer Mamba Elite
- Razer Ornata V2
- Gentoo Linux (OpenRC)
Install Required Packages
Load Kernel Modules
To load automatically at boot
Start D-Bus (Required)
Fix Permission Errors (udev Rule)
If you see errors like
Copy and Paste
cat > /etc/udev/rules.d/99-openrazer-sysfs-perms.rules <<'EOF'
# OpenRazer: allow users in plugdev to access sysfs driver attributes
# Fixes Permission denied for device_type/device_serial/dpi/device_mode etc.
ACTION=="add|change", SUBSYSTEM=="hid", ATTRS{idVendor}=="1532", \
RUN+="/bin/sh -c '\
base=/sys$env{DEVPATH}; \
chgrp -R plugdev \"$base\" 2>/dev/null; \
chmod g+rw \"$base\" 2>/dev/null; \
find \"$base\" -maxdepth 1 -type f -exec chmod 0660 {} + 2>/dev/null; \
# Keep serial files readable only (optional)
[ -e \"$base/device_serial\" ] && chmod 0640 \"$base/device_serial\" 2>/dev/null; \
# device_mode MUST be writable
[ -e \"$base/device_mode\" ] && chmod 0660 \"$base/device_mode\" 2>/dev/null; \
'"
# Ensure hidraw nodes are accessible too
ACTION=="add|change", SUBSYSTEM=="hidraw", ATTRS{idVendor}=="1532", MODE:="0660", GROUP:="plugdev"
EOF
Ensure hidraw devices are accessible
- Reload rules:
- Ensure your user is in the plugdev group:
- Re-login afterwards.
Start OpenRazer Daemon
RGB Control
- Set Static Yellow (RGB 255 255 0)
- Mouse (device 0)
Set Static Yellow (RGB 255 255 0) - Mouse is device: 0
Color Format Options
- razer-cli supports:
Add modules to autoload at boot
Troubleshooting
Ensure:
- Kernel modules loaded
- D-Bus running
- User in plugdev
- Permissions Error
Useful Commands
razer-cli help commands
razer-cli -h
usage: razer-cli [-h] [-man [MANUAL ...]] [-v] [-d DEVICE [DEVICE ...]]
[-a] [-e EFFECT [EFFECT ...]] [-c COLOR [COLOR ...]]
[-z ZONES [ZONES ...]] [-b BRIGHTNESS [BRIGHTNESS ...]]
[--dpi DPI] [--poll POLL]
[--battery BATTERY [BATTERY ...]] [-l] [-ll] [-ls]
[--sync] [--restore] [--version]
optional arguments:
-h, --help show this help message and exit
-man [MANUAL ...], --manual [MANUAL ...]
Print help details for given feature(s)
-v, --verbose increase output verbosity
-d DEVICE [DEVICE ...], --device DEVICE [DEVICE ...]
only affect these devices, same name as output of
-l
-a, --automatic try to find colors and set them to all devices
without user arguments, uses X or pywal colors
-e EFFECT [EFFECT ...], --effect EFFECT [EFFECT ...]
set effect
-c COLOR [COLOR ...], --color COLOR [COLOR ...]
choose color (default: X color1), use one argument
for hex, or three for base10 rgb
-z ZONES [ZONES ...], --zone ZONES [ZONES ...]
choose zone for color(s)
-b BRIGHTNESS [BRIGHTNESS ...], --brightness BRIGHTNESS [BRIGHTNESS ...]
set brightness of device
--dpi DPI set DPI of device (use print as a value to show
it)
--poll POLL set polling rate of device (use print as a value
to show it)
--battery BATTERY [BATTERY ...]
set low threshold and/or idle delay (use print as
a value to show it)
-l, --list_devices list available devices, settings, and their
supported capabilities/effects
-ll, --list_devices_long
list available devices settings, and list their
supported capabilities/effects
-ls, --list_devices_short
list available devices and their settings
--sync sync lighting effects to all supported Razer
products
--restore Load last used settings
--version Print version number
- OpenRazer is now fully configured on Gentoo.