timor / spacemacsOS

EXWM Layer to turn spacemacs into a full-fledged window manager
93 stars 11 forks source link

`setxkbmap -option caps:escape` only partially working (no capslock but also no escape) #16

Closed MElemental closed 4 years ago

MElemental commented 4 years ago

Hi I started using exwm and I can't seem to get my capslock to function as intended (functioning as escape). In a terminal SPC ' I ran the command setxkbmap -option caps:escape. Whenever I'm in insert mode it hitting capslock doesn't capitalize characters, which is good. However it also doesn't leave insert mode, which is not what I intended when I ran setxkbmap -option caps:escape.

If swapping caps and escape through setxkbmap in the terminal isn't ideal, what is a better way to swap caps and escape in exwm?

UPDATE: capslock also doesn't leave visual mode.

timor commented 4 years ago

I'm not really sure that is related to exwm or spacemacs. Are you following some kind of guide where it says that capslock is supposed to function like escape?

MElemental commented 4 years ago

I found out that my caps lock got mapped to ctrl for some reason. I managed to clear my xkbmap settings.

MElemental commented 4 years ago

It seems I have to run setxkbmap -option then run setxkbmmap -option caps:escape otherwise it swaps caps with ctrl instead. It seems to work as expected when I open in the xfce enviornment, but it want's to change to caps to ctrl in exwm.

I've added the following to my dotspacemacs/user-init to address this:

  (shell-command "setxkbmap -option")
  (shell-command "setxkbmap -option caps:escape")

I don't know if it's worth reopening, but I thought I'd leave this here for anyone else that may stumble upon this.

MElemental commented 4 years ago

I wanted to update this again, It seems that the file exwm-start bash file (in this repo) has this line in it: setxkbmap -option 'ctrl:no caps'

So if you don't want to do it from .spacemacs you can edit that file to whatever keyboard mappings you want.