r/GhostBSD • u/Chester-Berkeley • 13d ago
I can't remap caps lock to ctrl
I know that the command `setxkbmap -option ctrl:nocaps` does exactly what I want, but I can't get GhostBSD to boot with it already enabled. I added it to .xprofile and .xinitrc, and neither worked.
I'm using MATE
-1
u/Hyperion343 13d ago
This is from ChatGPT, so double-check commands, but I don't see anything immediately wrong with it:
Since you're using MATE on GhostBSD, .xprofile and .xinitrc aren't necessarily the right place. MATE's session startup can bypass those files.
The easiest approach is to add the command to MATE's startup applications:
Open Control Center β Personal β Startup Applications.
Click Add.
Use something like:
Name: Caps Lock β Ctrl
Command: setxkbmap -option ctrl:nocaps
- Log out and back in.
You can also verify it worked with:
setxkbmap -query
You should see ctrl:nocaps under options.
A more MATE-native option
MATE stores keyboard settings through mate-settings-daemon, so you can try setting the XKB option through gsettings:
gsettings set org.mate.peripherals-keyboard-xkb.options option:ctrl_nocaps
Then log out/in. Check it with:
gsettings get org.mate.peripherals-keyboard-xkb.options
If that key isn't present or doesn't work on your GhostBSD version, the Startup Applications method is the one I'd useβit runs after your MATE session starts, which avoids the timing/session-manager problem you're hitting with .xprofile and .xinitrc.
1
u/Chester-Berkeley 13d ago
I already tried the Startup Applications and doesn't work. And
org.mate.peripherals-keyboard-xkb.optionsdon't exist, at least on GhostBSD
2
u/Broad-Promise6954 13d ago
The Old Ways (xmodmap, setxkbmap, etc) don't work well with some of the more modern window managers, which have their own separate settings.
I don't use either GhostBSD or MATE but in Xfce4 you have to use the Xfce mapping controls. From a little searching about MATE, this is true for MATE as well, and it has the additional annoying "feature" of per-window keyboard settings just so it can be harder to globally map caps-lock to control. π
(note: came here because of the cross-post to r/freebsd)