Crash when toggling off CAPS LOCK

Solution 1:

I also have a New Razer Blade Stealth and I had the same problem but fixed it installing the razer keyboard driver for linux which you can find here on GitHub and disabling the built in keyboard driver.

There's a PPA for Ubuntu (16.04 and newer):

sudo add-apt-repository ppa:openrazer/stable
sudo apt update
sudo apt install openrazer-meta

If you get dependency errors when trying to install these driver packages make sure that you have enabled the universe repository in Software & Updates. There is also a development PPA (ppa:openrazer/daily).

Reboot, or insert the new module from the terminal:

sudo modprobe razerkbd

After installing the driver you should see it

lsmod | grep "razerkbd"

Second disable the built-in keyboard driver that causes the problem. First find the name of the driver.

xinput list

Disable it ("AT Raw Set 2 keyboard" in my case)

xinput set-prop "AT Raw Set 2 keyboard" "Device Enabled" 0

If this no longer produces an error, make the changes permanent.

cd /etc/X11/
sudo mkdir xorg.conf.d
cd xorg.conf.d/
sudo touch 20-razer.conf
sudo xed 20-razer.conf 

Copy the following to 20-razer.conf

Section "InputClass"
    Identifier      "Disable built-in keyboard"
    MatchIsKeyboard "on"
    MatchProduct    "AT Raw Set 2 keyboard"
    Option          "Ignore"    "true"
EndSection

Reboot and check that the CAPS-lock key no longer produces the crash.

Solution 2:

Jorge Garza's answer helps, but after suspend the problem was back. Adding the fix to /etc/pm/sleep.d/20_razer helps.

#!/bin/sh
case $1 in
     suspend|suspend_hybrid|hibernate)
     # everything is fine
     ;;
     resume|thaw)
     xinput set-prop "AT Raw Set 2 keyboard" "Device Enabled" 0
    ;;
esac

as explained here on GitHub