1

I am trying to implement a keyboard layout switcher for xmonad as per How do I change my keyboard layout while using xmonad?.

I want to use Alt+LShift since it is what I have used in years:

main = do
  xmonad $ defaultConfig
     {
        terminal = "gnome-terminal"
     } `additionalKeys`
     [ (( mod1Mask , xK_Shift_L), spawn "/home/gauthier/bin/layout_switch.sh")
     ]

My problem is that applications do not respond to shortcuts that contain Alt+LShift anymore. For example in emacs, I usually type M-< this way: LAlt+LShift+..

With the layout switcher setup above, xmonad takes the key chord, and emacs gets nothing.

How can I keep the shortcut for keyboard switcher, and still have other applications take such shortcuts? I am ok with the keyboard switcher actually changing layout on release of Alt+LShift.

1 Answer 1

2

The solution was to skip the script, and set the keyboard switch shortcut with setxkbmap.

I now run this in my login script:

# Keyboard layout switcher
setxkbmap -layout us,se -variant ,kinesis -option 'grp:alt_shift_toggle'

This does exactly what I wanted.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .