Project home: https://bues.ch/h/razercfg Original repository at: https://git.bues.ch/git/razer.git https://bues.ch/h/razercfg

Michael Buesch 1fe4956a00 Update release scripts and remove Debian build scripts 7 mēneši atpakaļ
firmware 89ea08bafa Update email address 13 gadi atpakaļ
librazer dbae0da062 Deactivate Lachesis 5600 support 6 gadi atpakaļ
razerd d45706738b Fix systemd service install 7 mēneši atpakaļ
scripts 1fe4956a00 Update release scripts and remove Debian build scripts 7 mēneši atpakaļ
ui 357d75dad1 Bump version 7 mēneši atpakaļ
.gitignore c2ed0452db Ignore the generated desktop file 9 gadi atpakaļ
CMakeLists.txt d45706738b Fix systemd service install 7 mēneši atpakaļ
COPYING 5ae2be7c22 Add a copy of the GNU GPL 17 gadi atpakaļ
HACKING.md 71dd37998a README: Update 8 gadi atpakaļ
README.md 205e86b666 Update Readme.md 7 mēneši atpakaļ
pm-hook.sh.template ea7e5f7a55 use configure_file rather than custom_command 10 gadi atpakaļ
razer.conf 532d8e463b included Diamondback config in razer.conf 7 gadi atpakaļ
razerd.initscript 472eb26f89 Sysv init: add dependency to $remote_fs in init script 7 gadi atpakaļ
razerd.service.template d45706738b Fix systemd service install 7 mēneši atpakaļ
tmpfile.conf fa85551105 Add tmpfile.conf 6 gadi atpakaļ
udev.rules.template 83236d888a udev: Only rescan if the removed device is from Razer 4 gadi atpakaļ
uninstall.sh 4751ae3679 uninstall.sh: Add tmpfiles.d 5 gadi atpakaļ

README.md

Razer device configuration tool

https://bues.ch/h/razercfg

This is a configuration utility for Razer devices on Linux systems.

Supported devices

Device support table at https://bues.ch/h/razercfg#device_support

Dependencies

Note that almost all distributions ship prebuilt packages of the above dependencies.

If you installed a dependency after you already ran cmake . and/or make, it might happen that the dependency is still not found. Just delete the cmake status files or unpack a clean razercfg tarball to workaround this issue.

Building

First invoke cmake to build the makefiles. Then invoke make to build the binaries:

cmake .
make

(Note the required space and dot after the cmake command)

Installing

First you need to install the tool libraries and binaries. Do this by executing the following command as root:

make install

Be aware that make install installs the shared library librazer.so to $PREFIX/lib. The default $PREFIX is /usr/local/, but the install prefix can also be changed via -DCMAKE_INSTALL_PREFIX='<somewhere>'. You have to make sure that librazer.so in $PREFIX/lib/ can be found by the dynamic linker ld.so. Your operating system most likely already has support for libraries in /usr/local/lib. So on most systems you don't have to do anything. If this is not the case, or you installed razercfg somewhere else, a new library search path can be added via /etc/ld.so.conf or /etc/ld.so.conf.d/. See your operating system manual for further information.

If you use systemd:

The make install step installed the razerd.service file. Reboot or run the following command as root to start the razerd daemon:

systemctl start razerd

If you do not use systemd:

To automatically start the required system daemon razerd at bootup time, you need to install the init-script. This software package includes a generic example script, that should work out-of-the-box on many Linux distributions. To install it, invoke the following commands as root:

cp ./razerd.initscript /etc/init.d/razerd
ln -s /etc/init.d/razerd /etc/rc2.d/S99razerd
ln -s /etc/init.d/razerd /etc/rc5.d/S99razerd
ln -s /etc/init.d/razerd /etc/rc0.d/K01razerd
ln -s /etc/init.d/razerd /etc/rc6.d/K01razerd

If you use udev:

The make install step installed the udev script to

/etc/udev/rules.d/80-razer.rules
This should work on most distributions.

If udev notification does not work, try to reboot the system.

RazerD Configuration

The user may create a razerd configuration file in /etc/razer.conf which can be used to specify various razerd options and initial hardware configuration settings. An example config file is included as razer.conf in this package. If no configuration file is available, razerd will work with default settings.

X Window System (X.ORG) Configuration

If you don't have an xorg.conf, you don't have to do anything and it should work out-of-the-box.

X must not be configured to a specific mouse device like /dev/input/mouse0. On configuration events, razerd may have to temporarily unregister the mouse from the system. This will confuse X, if it's configured to a specific device. Configure it to the generic /dev/input/mice device instead. This will enable X to pick up the mouse again after a configuration event from razerd.

Example xorg.conf snippet:

Section "InputDevice"
    Identifier  "Mouse"
    Driver  "mouse"
    Option  "Device" "/dev/input/mice"
EndSection

Alternatively, do not specify a "Device" at all. X will autodetect the device then:

Section "InputDevice"
    Identifier  "Mouse"
    Driver  "mouse"
EndSection

In any case, do NOT use: Option "Device" "/dev/input/mouseX"

Using the tools

To use the tools, the razerd daemon needs to be started as root, first. Without the background daemon, nothing will work. The daemon is responsible for doing the lowlevel hardware accesses and for tracking the current state of the device. While the daemon is running, the user interfaces razercfg (commandline) and qrazercfg (graphical user interface) can be used.

Uninstalling

If you installed razercfg with your distribution packaging system, use that to uninstall razercfg.

If you compiled razercfg from source and installed it with make install, you can use the uninstall.sh script from the razercfg archive to uninstall razercfg from the system. It must be called with the install prefix as its first argument. That usually is /usr/local, unless specified otherwise in cmake. A call to uninstall.sh might look like this:

./uninstall.sh /usr/local

Architecture

The architecture layout of the razer tools looks like this:

 -------------------
| hardware driver 0 |--v
 -------------------   |
                       |    ----------
 -------------------   |   | lowlevel |     --------      ---------
| hardware driver 1 |--x---| librazer |----| razerd |----| pyrazer |
 -------------------   |    ----------      --------      ---------
                       |                        |           ^ ^ ^
 -------------------   |     ---------------------------    | | |
| hardware driver n |--^    | (to be written) librazerd |   | | |
 -------------------         ---------------------------    | | |
                                              ^ ^ ^         | | |
                                              | | |         | | |
                           ---------------    | | |         | | |
                          | Application 0 |---^ | |         | | |
                           ---------------      | |         | | |
                                                | |         | | |
                           ---------------      | |         | | |
                          | Application 1 |-----^ |         | | |
                           ---------------        |         | | |
                                                  |         | | |
                           ---------------        |         | | |
                          | Application n |-------^         | | |
                           ---------------                  | | |
                                                            | | |
                           ----------                       | | |
                          | razercfg |----------------------^ | |
                           ----------                         | |
                                                              | |
                           -----------                        | |
                          | qrazercfg |-----------------------^ |
                           -----------                          |
                                                                |
                            --------------------------          |
                          | Other Python applications |---------^
                           ---------------------------

So in general, your application wants to access the razer devices through pyrazer or (if it's not a python app) through librazerd. (Note that librazerd is not written, yet. So currently the only way to access the devices is through pyrazer). Applications should never poke with lowlevel librazer directly, because there will be no instance that keeps track of the device state and permissions and concurrency.

License

Copyright (c) 2007-2024 Michael Büsch, et al.

See the COPYING file for license information.