Custom keyboard layout is not loaded automatically and does not work in terminal

Hello everyone,

I wrote my own keyboard layout and stored it as /home/david/.Xmodmap. I can activate it with xmodmap /home/david/.Xmodmap .
The first problem is that the new keyboard layout only works outside of the terminal.

I also created a file called myxmod.desktop that looks like this:

[Desktop Entry]
Name=MyXmodmap
MimeType=
Exec=xmodmap /home/david/.Xmodmap
Type=Application
GenericName=Terminal
Terminal=false
Icon=terminal
Comment=xmodmap
X-KDE-StartupNotify=false
Categories=System;
X-GNOME-UsesNotifications=true

I stored this file in ./config/autostart but the new keyboard layout does not automatically work after a startup.

I hope you can help me!

David

PS: Information about my software and hardware:

manjaro%  inxi -Fazy
System:
  Kernel: 5.9.16-1-MANJARO x86_64 bits: 64 compiler: gcc v: 10.2.0 
  parameters: BOOT_IMAGE=/boot/vmlinuz-5.9-x86_64 
  root=UUID=116ef32c-01ce-4135-b673-172a7f9c2c4d rw quiet splash apparmor=1 
  security=apparmor udev.log_priority=3 
  Desktop: GNOME 3.38.2 tk: GTK 3.24.24 wm: gnome-shell dm: GDM 3.38.2.1 
  Distro: Manjaro Linux 
Machine:
  Type: Desktop Mobo: ASUSTeK model: P8B75-M LX PLUS v: Rev X.0x 
  serial: <filter> UEFI: American Megatrends v: 0501 date: 10/10/2012 
CPU:
  Info: Quad Core model: Intel Core i5-3330 bits: 64 type: MCP 
  arch: Ivy Bridge family: 6 model-id: 3A (58) stepping: 9 microcode: 21 
  L2 cache: 6 MiB 
  flags: avx lm nx pae sse sse2 sse3 sse4_1 sse4_2 ssse3 bogomips: 23956 
  Speed: 1596 MHz min/max: 1600/3200 MHz Core speeds (MHz): 1: 1596 2: 1597 
  3: 1597 4: 1597 
  Vulnerabilities: Type: itlb_multihit status: KVM: VMX unsupported 
  Type: l1tf mitigation: PTE Inversion 
  Type: mds mitigation: Clear CPU buffers; SMT disabled 
  Type: meltdown mitigation: PTI 
  Type: spec_store_bypass 
  mitigation: Speculative Store Bypass disabled via prctl and seccomp 
  Type: spectre_v1 
  mitigation: usercopy/swapgs barriers and __user pointer sanitization 
  Type: spectre_v2 mitigation: Full generic retpoline, IBPB: conditional, 
  IBRS_FW, STIBP: disabled, RSB filling 
  Type: srbds status: Vulnerable: No microcode 
  Type: tsx_async_abort status: Not affected 
Graphics:
  Device-1: Intel Xeon E3-1200 v2/3rd Gen Core processor Graphics 
  vendor: ASUSTeK P8H77-I driver: i915 v: kernel bus ID: 00:02.0 
  chip ID: 8086:0152 
  Device-2: NVIDIA GK106 [GeForce GTX 650 Ti] vendor: Gigabyte driver: nouveau 
  v: kernel bus ID: 01:00.0 chip ID: 10de:11c6 
  Display: wayland server: X.org 1.20.10 compositor: gnome-shell 
  driver: intel,nouveau unloaded: modesetting alternate: fbdev,nv,vesa 
  display ID: 0 resolution: <missing: xdpyinfo> 
  OpenGL: renderer: NVE6 v: 4.3 Mesa 20.3.1 direct render: Yes 
Audio:
  Device-1: Intel 7 Series/C216 Family High Definition Audio 
  vendor: ASUSTeK P8Z77-V LX driver: snd_hda_intel v: kernel bus ID: 00:1b.0 
  chip ID: 8086:1e20 
  Device-2: NVIDIA GK106 HDMI Audio vendor: Gigabyte driver: snd_hda_intel 
  v: kernel bus ID: 01:00.1 chip ID: 10de:0e0b 
  Device-3: Microdia Webcam Vitade AF type: USB driver: snd-usb-audio,uvcvideo 
  bus ID: 1-4:2 chip ID: 0c45:6366 serial: <filter> 
  Sound Server: ALSA v: k5.9.16-1-MANJARO 
Network:
  Device-1: Realtek RTL8192CE PCIe Wireless Network Adapter vendor: ASUSTeK 
  driver: rtl8192ce v: kernel port: d000 bus ID: 03:00.0 chip ID: 10ec:8178 
  IF: wlp3s0 state: up mac: <filter> 
  Device-2: Realtek RTL8111/8168/8411 PCI Express Gigabit Ethernet 
  vendor: ASUSTeK P8 series driver: r8169 v: kernel port: c000 bus ID: 04:00.0 
  chip ID: 10ec:8168 
  IF: enp4s0 state: down mac: <filter> 
Drives:
  Local Storage: total: 931.51 GiB used: 47.01 GiB (5.0%) 
  SMART Message: Required tool smartctl not installed. Check --recommends 
  ID-1: /dev/sda maj-min: 8:0 vendor: Hitachi model: HDS721010DLE630 
  size: 931.51 GiB block size: physical: 4096 B logical: 512 B speed: 6.0 Gb/s 
  serial: <filter> rev: A650 
Partition:
  ID-1: / raw size: 48.83 GiB size: 47.81 GiB (97.92%) used: 16.41 GiB (34.3%) 
  fs: ext4 dev: /dev/sda9 maj-min: 8:9 
  ID-2: /boot/efi raw size: 512 MiB size: 511 MiB (99.80%) 
  used: 324 KiB (0.1%) fs: vfat dev: /dev/sda7 maj-min: 8:7 
  ID-3: /home raw size: 50.63 GiB size: 49.59 GiB (97.94%) 
  used: 30.61 GiB (61.7%) fs: ext4 dev: /dev/sda10 maj-min: 8:10 
Swap:
  Kernel: swappiness: 60 (default) cache pressure: 100 (default) 
  ID-1: swap-1 type: partition size: 2 GiB used: 0 KiB (0.0%) priority: -2 
  dev: /dev/sda8 maj-min: 8:8 
Sensors:
  System Temperatures: cpu: 29.8 C mobo: 27.8 C gpu: nouveau temp: 28.0 C 
  Fan Speeds (RPM): N/A gpu: nouveau fan: 1260 
Info:
  Processes: 218 Uptime: 16m wakeups: 0 Memory: 7.64 GiB 
  used: 2.11 GiB (27.5%) Init: systemd v: 247 Compilers: gcc: 10.2.0 Packages: 
  pacman: 1376 lib: 382 flatpak: 0 Shell: Zsh v: 5.8 
  running in: gnome-terminal inxi: 3.2.01 

I think you need to invoke it in your .bashrc or .bash_profile