My keyboard layout (setxkbmap) gets disregarded after a while

Hello Manjaro users!

I’ve written a script with some setxkbmap-commands that sets up the eurkey-layout and remaps Caps Lock to Control (I’ve found these commands by searches online).

I’ve added the script in the Application Autostart-tab of Session and Startup. This works great, for a little while (a couple of minutes). Suddenly the mouse pointer freezes (i.e. it stops responding to mouse movements) for a few seconds, and after that my custom settings are gone. If I manually execute the script again, it works for a while and the problem reoccurs.

I’ve tried some variations of the settings in the Keyboard > Layout-tab but this hasn’t lead to any success.

Here is the script if relevant:

#!/bin/sh

setxkbmap eu
setxkbmap -option caps:none
setxkbmap -option ctrl:nocaps
setxkbmap -option "shift:both_capslock"

Is there anything I can do to not have to execute the script manually every few minutes?

Use a xorg config? Xorg/Keyboard configuration - ArchWiki

Hi. You can try to set custom keyboard options with localectl set-x11-keymap. See
https://man.archlinux.org/man/localectl.1