You are not logged in.
Pages: 1
Topic closed
I have my Caps Lock key mapped to L_Control on my Keyboard.
To acheive this I used to have the following line at the end of my .i3/config file
exec --no-startup-id setxkbmap -option ctrl:nocaps
and it has worked well for me, so far.
Recently, I got a KVM switch to share the keyboard and mouse between my desktop and my laptop, however when I switch over to my laptop and back to my dekstop, the XkbOptions seems to have reset.
Is there someway to execute the setxkbmap command everytime a new keyboard is detected by the system (write a systemd unit file?)
I have tried adding the following two lines to my /etc/X11/xorg.conf file under the Keyboard InputDevice section, but still no luck
Option "XkbLayout" "us"
Option "XkbOptions" "ctrl:nocaps"
Any suggestions?
Last edited by elric_ed (2018-02-16 04:15:44)
Offline
Why do you have a /etc/X11/xorg.conf file, what does it look like and please paste your xorg log.
Offline
I had my xorg.conf file generated from nvidia-settings.
My xorg.conf file (with the issue) is here: https://pastebin.com/uMYn1Vna
I was able to solve the issue by changing my Keyboard section in the xorg.conf file as follows:
Section "InputClass"
# generated from default
Identifier "Keyboard0"
MatchIsKeyboard "on"
Driver "kbd"
Option "XkbLayout" "us"
Option "XkbOptions" "ctrl:nocaps"
EndSection
I had to set the MatchIsKeyboard option to "on"; and change the Section from "InputDevice" to "InputClass"
Now, Xorg behaves as expected!
Offline
You should not be using a static xorg.conf (deprecated, tends to cause trouble, easily breaks on HW changes) and especially not an auto-generated one because they tend to be full or crufty nonsense, like that keyboard section (I will just assume that you do not have xf86-input-keyboard installed and you should not because you most likely do not want to use it)
See https://wiki.archlinux.org/index.php/Xorg#Configuration
You most likey want some snippet in /etc/X11/xorg.conf.d/20-keyboard-layout.conf
Section "InputClass"
Identifier "keyboard_layout"
MatchIsKeyboard "on"
Option "XkbLayout" "us"
Option "XkbOptions" "ctrl:nocaps"
EndSection
Offline
Thank you seth!
I am working on splitting my xorg configurattion into multiple files in /etc/X11/xorg.conf.d/*.conf now
Offline
Alright, I've found this here. I have a simple script in /.config that turns my Caps Lock into... Caps Lock automatically at login (I use a Colemak keyboard, and the default setting has the Caps key working as backspace, so I have 2 backspaces and no Caps): it simply runs
xmodmap -e "keycode 66 = Caps_Lock"
and that's it.
Now, when I plug in whatever other USB device, the settings go back to default. If I've understood what Seth said, I should also edit my 00-keyboard.conf file (here it's 00, not 20, but anyway...)
Seems fine enough. Now, I'm just not sure what kind of line I add there, because, you know, the key kind of is Caps, but is set as a backspace
Would it be something like Option "XkbOptions" "caps:nobackspace"?
Offline
Please don't necrobump w/ completely unrelated topics, your problem is that you don't like the colemak layout and/or (because I've no idea what that actually looks like) you're setting caps:backspace
Don't run that xmodmap script, what's the output of
setxkbmap -print -query
xmodmap -pk | grep -Ei '(66|caps)'
xev -event keyboard # now press the caps lock key
Last edited by seth (2023-07-28 15:33:39)
Offline
Dinosalsa, I am going to close this five year old solved thread. I invite you to start a new thread which you will own. If you think this thread relevant, go ahead and link back to this thread.
Nothing is too wonderful to be true, if it be consistent with the laws of nature -- Michael Faraday
Sometimes it is the people no one can imagine anything of who do the things no one can imagine. -- Alan Turing
---
How to Ask Questions the Smart Way
Offline
Pages: 1
Topic closed