You are not logged in.
For a while now, I have been using the XkbOption caps:swapescape and find it quite handy.
I have gotten a us-keyboard now and I would like to be able to switch keyboard layouts (us and de) by pressing Esc.
When I disable caps:swapescape, grp:caps_toggle works perfectly fine. However, both together won't produce the result I want, hitting Esc still results in a normal CapsLock.
What is the best workaround for this?
Last edited by maddingl (2018-03-20 09:14:43)
Offline
If anyone is interested: I have found a solution.
I wrote a little script named "toggle-xkbmap" that I put in $HOME/bin/ :
#!/bin/bash
STATE=$(xkblayout-state print %s)
if [ "$STATE" == "de" ]
then
setxkbmap us
else
setxkbmap de
fiand in my i3config, I have:
...
# toggle keyboard layout
bindsym Caps_Lock exec $HOME/bin/toggle-xkbmap
...
exec --no-startup-id xkbset nullify lock
exec --no-startup-id setxkbmap -option caps:swapescape
...the nullify lock is necessary, otherwise, I would always turn on capslock whenever I switch to the not default layout (in my case, german). I found it on this site.
xkbset is in the AUR.
Offline