How to get OpenRazer working easily on Steam Deck

Questo articolo è stato scritto oltre 1 years, il contenuto potrebbe essere datato.

I have a Steam Deck and I play with the Razer Tartarus (before with Nostromo) and sometimes also with a Razer mouse. Those devices are for gamers and require specific driver installed on the machine to let them recognized their specific buttons as examples.

If you are looking for an Italian review, check my video where I talk also about this tutorial!

OpenRazer are the open source driver implementations that let you use those devices on Linux. They extend the Linux kernel with their own driver and require some steps to proceed.

Introduction

SteamOS on the SD is updated by the native client and doesn’t include “things”. The first stuff that you need to know, if you don’t know Linux, is that SD use various partitions where your games, settings and app installed with KDE discover on the Desktop Mode are saved. The real OS like the program for the Desktop mode or “Linux” are in a specific partition that is on read only.

If you are interested on how to change the language in the desktop mode, I wrote a tutorial also for that!

This means that you can just read, and you are not able to do any change. It is something common on Linux to avoid that you break things, but this means that if you are doing something like adding the support for the Razer devices at next update you have to install it again.

The next things you need to know is this device the OS is based on ArchLinux with custom Steam repositories. On Linux distributions a package repository is a “centralized server” that has all the software that you are capable to install with just a command (and they are tested and safe usually). This means that you are not using the ArchLinux original but a different version and OpenRazer is not there, and you have to compile it.

In IT, compile a software it means from source code generate the binary, driver, executable etc.

Let’s start with the 3 installation steps!

Set password for the deck user

On SD there is the deck user that run all the programs/games but doesn’t have any password defined. To proceed we need to set one, so in Desktop mode open the terminal (Konsole) and write passwd and press Enter.

You can use the overlay keyboard with Steam+X or with the dock station a real keyboard or a Bluetooth keyboard. How to set up one is not part of this tutorial.

I set deck as password in this way is the same user and I don’t confuse it with others.

Install OpenRazer

To achieve something that I can reuse (we will see later), I preferred to create a bash script with various commands:

#!/bin/bash

sudo steamos-readonly disable 
sudo gpasswd -a deck plugdev
sudo sed -i "s/SigLevel    = Required DatabaseOptional/SigLevel = Never/g" /etc/pacman.conf
sed -i "s/LocalFileSigLevel = Optional/#LocalFileSigLevel = Optional/g" /etc/pacman.conf
sudo pacman-key --refresh-keys
sudo pacman-key --init
sudo pacman -Sy archlinux-keyring
sudo pacman -S --overwrite \* fakeroot base-devel
sudo pacman-key --populate archlinux
sudo pacman -Syu base-devel mlocate cmake gcc holo-rel/linux-headers jupiter-rel/linux-neptune-headers holo-rel/linux-lts-headers $(pacman -Qk 2>/dev/null | grep -ve ' 0 missing' | grep -ie ^libc -e glibc -e gcc -e clang -e headers -e udev -e systemd | awk -F ':' '{print $1}') --overwrite '*'
cd /tmp/
git clone https://aur.archlinux.org/openrazer-git.git
cd openrazer
makepkg -sri
systemctl --user enable --now openrazer-daemon.service

This code is based on others that I found online, but it’s tested and improved.
Create a file and calling as you prefer, in my case is openrazer.sh. I put that on the sd card to get that on the SD easily and write every single command manually.

Next step, in the Desktop mode, open the file manager (Dolphin) and go to the sd card folder that should be /run/media/mmcblk0p1. Now right-click on the bash script and on Proprieties->Permissions check the Executable option and press Ok. Now the script can be executed.

If you still have opened the terminal, you can drag and drop the bash file so automatically fill it the path (if you don’t want to write it manually /run/media/mmcblk0p1/openrazer.sh) and press enter (or press A as it is recognized as Enter).

Now the procedure started and will sometimes ask you to insert the deck user password that we set before or to allow the (re)installation of some packages (just press y).

The script will proceed and will disable the read-only mode, get the list of packages by the repositories, install the dependencies, download the OpenRazer package source for ArchLinux compile it, install it and enable the user.

RazerGenie

Before the reboot, you want to install with KDE Discover the GUI to manage the lights for the Razer devices, in this case RazerGenie. It is not similar to the one on Windows (it’s more fast anyway) and doesn’t allow you to set custom mappings, but just change the lights. I didn’t look for a way to customize the mappings, as for me, they were fine, as anyway in the steam deck you have to remap everything.

After the reboot, you will have the Razer devices working.

Here you can see a photo of Tartarus and the Tron mouse, both by Razer: https://www.instagram.com/p/CmjsmO3IA1V/

What to do on a new update

So Steam release a new shiny update to SteamOS and you have to repeat everything, but what specifically?

  • Set again the deck user password (I am not sure about this right now, but anyway the script cannot proceed if there is any password configured)
  • Execute again the bash script (if you don’t delete the file, it will already have the executable permissions)

EDIT:

  • 2023/03/11 – Updated script to change pacman settings to avoid package verification
  • 2024/01/29 – Updated script to latest missing packages and command order, removed some quest comments as they are talking about old issues
Liked it? Take a second to support Mte90 on Patreon!
Become a patron at Patreon!

13 thoughts on “How to get OpenRazer working easily on Steam Deck

  1. Hey there, I followed these steps to a T and everything went through on Kommand (terminal). However, I do not see the OpenRazer program anywhere on my deck to use. Is it supposed to be a viewable / run-able program? I am wanting to assign macros to the buttons on my Razer mouse. Thanks in advance for your reply.

    1. Hi OpenRazer is just a driver, the tool to manage macro and so on is another one. the article mention razorgenie as example.

      1. I got RazorGenie for the RGB settings. Do you know of a tool or program that can manage the macro inputs?

        1. No I have no idea, I searched on internet but seems that there aren’t any editor right now to configure macro.
          Someone already asked https://github.com/openrazer/openrazer/issues/2034 but someone suggests to configure the macro on windows because some models save in the hardware the settings.
          Other suggests https://github.com/sezanzeb/input-remapper that is used as tool on linux for this kind of things.
          That one is available on Archlinux so it is possible to extend the script to install it too https://aur.archlinux.org/packages/input-remapper-git

  2. Hi Daniele,

    I repeated the whole installation procedure because today RazerGenie was no more working. After installation, when I start RazerGenie it tells that the OpenRazer daemon is not installed or the actual installed version is too old. I don’t know how to solve this issue. Thank you for your help.

    1. Hi,
      I need the script output to see if everything worked.
      Sometimes running twice fixed the issue but without any hint of that it is difficult to investigate.

  3. Hi Daniele,

    thank you for providing the script. I executed it twice, but am still getiing this as the last entries within the console. Any idea what I might be doing wrong, or if I am missing a binary?


    warning: systemd-sysvcompat-253.5-2 is up to date — reinstalling
    Cloning into ‘openrazer’…
    remote: Enumerating objects: 218, done.
    remote: Counting objects: 100% (218/218), done.
    remote: Compressing objects: 100% (136/136), done.
    remote: Total 218 (delta 82), reused 218 (delta 82), pack-reused 0
    Receiving objects: 100% (218/218), 72.62 KiB | 1.40 MiB/s, done.
    Resolving deltas: 100% (82/82), done.
    ==> ERROR: Cannot find the fakeroot binary.
    Failed to enable unit: Unit file openrazer-daemon.service does not exist.
    gpasswd: group ‘plugdev’ does not exist in /etc/group

  4. Thank you,
    I am no longer getting the previous error, but a different one now, which seems to occur during the python build:
    ==> Entering fakeroot environment…
    ==> Starting package_python-openrazer()…
    /tmp/openrazer/PKGBUILD: line 21: make: command not found
    ==> ERROR: A failure occurred in package_python-openrazer().
    Aborting…

  5. Hi Daniele,

    I got the previous error fixed by adding base-devel prior to running the script with ‘pacman -S base-devel’

    It ran through, but I got the message
    Job for openrazer-daemon.service failed because the control process exited with error code.
    See “systemctl –user status openrazer-daemon.service” and “journalctl –user -xeu openrazer-daemon.service” for details.

    running both commands yields:
    (deck@steamdeck Desktop)$ systemctl –user status openrazer-daemon.service
    × openrazer-daemon.service – Daemon to manage razer devices in userspace
    Loaded: loaded (/usr/lib/systemd/user/openrazer-daemon.service; enabled; preset: enabled)
    Active: failed (Result: exit-code) since Tue 2024-01-23 19:50:11 CET; 2min 54s ago
    Docs: man:openrazer-daemon(8)
    Process: 36030 ExecStart=/usr/bin/openrazer-daemon -F (code=exited, status=1/FAILURE)
    Main PID: 36030 (code=exited, status=1/FAILURE)
    CPU: 173ms

    Jan 23 19:50:11 steamdeck openrazer-daemon[36030]: 2024-01-23 19:50:11 | razer | CRI>
    Jan 23 19:50:11 steamdeck openrazer-daemon[36030]: Stopping daemon.
    Jan 23 19:50:11 steamdeck openrazer-daemon[36030]: Exception ignored in atexit callback:
    Jan 23 19:50:11 steamdeck openrazer-daemon[36030]: Traceback (most recent call last):
    Jan 23 19:50:11 steamdeck openrazer-daemon[36030]: File “/usr/lib/python3.11/site-packages/daemonize.py”, l>
    Jan 23 19:50:11 steamdeck openrazer-daemon[36030]: sys.exit(0)
    Jan 23 19:50:11 steamdeck openrazer-daemon[36030]: SystemExit: 0
    Jan 23 19:50:11 steamdeck systemd[979]: openrazer-daemon.service: Main process exited, code=exited, status=1/>
    Jan 23 19:50:11 steamdeck systemd[979]: openrazer-daemon.service: Failed with result ‘exit-code’.
    Jan 23 19:50:11 steamdeck systemd[979]: Failed to start Daemon to manage razer devices in userspace.

    (130)(deck@steamdeck Desktop)$ journalctl –user -xeu openrazer-daemon.service
    Jan 23 19:50:11 steamdeck openrazer-daemon[36030]: Exception ignored in atexit callback:
    Jan 23 19:50:11 steamdeck openrazer-daemon[36030]: Traceback (most recent call last):
    Jan 23 19:50:11 steamdeck openrazer-daemon[36030]: File “/usr/lib/python3.11/site-packages/daemonize.py”, l>
    Jan 23 19:50:11 steamdeck openrazer-daemon[36030]: sys.exit(0)
    Jan 23 19:50:11 steamdeck openrazer-daemon[36030]: SystemExit: 0
    Jan 23 19:50:11 steamdeck systemd[979]: openrazer-daemon.service: Main process exited, code=exited, status=1/>
    ░░ Subject: Unit process exited
    ░░ Defined-By: systemd
    ░░ Support: https://lists.freedesktop.org/mailman/listinfo/systemd-devel
    ░░
    ░░ An ExecStart= process belonging to unit UNIT has exited.
    ░░
    ░░ The process’ exit code is ‘exited’ and its exit status is 1.
    Jan 23 19:50:11 steamdeck systemd[979]: openrazer-daemon.service: Failed with result ‘exit-code’.
    ░░ Subject: Unit failed
    ░░ Defined-By: systemd
    ░░ Support: https://lists.freedesktop.org/mailman/listinfo/systemd-devel
    ░░
    ░░ The unit UNIT has entered the ‘failed’ state with result ‘exit-code’.
    Jan 23 19:50:11 steamdeck systemd[979]: Failed to start Daemon to manage razer devices in userspace.
    ░░ Subject: A start job for unit UNIT has failed
    ░░ Defined-By: systemd
    ░░ Support: https://lists.freedesktop.org/mailman/listinfo/systemd-devel
    ░░
    ░░ A start job for unit UNIT has finished with a failure.
    ░░
    ░░ The job identifier is 1398 and the job result is failed.

    1. Script updated after talking with the package maintainer for Archlinux, seems that the last command in the script wasn’t executed initially so there is the error.
      I updated the script in the article to put it on top.

Leave a Reply

Your email address will not be published. Required fields are marked *