1

I want to set the caps lock key working as a modifier (modkey) and layout switcher at the same time.

  • I want Caps Lock to act as a modkey in awesome in different hotkey combinations, for example, Caps Lock + Enter opens terminal and so on.
  • When Caps Lock is pressed as a single key, it should act as a layout switcher on its release (by calling function that executes setxkbmap in rc.lua config).

How can I accomplish that?

I tried to turn Caps Lock into a modkey, but modkey = "Lock" in rc.lua does not seem to work right now, and after I finally made it work somehow (with xmodmap or changing the latter line in config), modkey was acting exactly the way Caps Lock acts: one press turnes it on, and another turns it off. Even if I make Caps Lock the modkey instead of Super_L, I still have no idea of how to handle its single-key release.

  • 1
    I managed to get Caps Lock working to switch layouts: os.execute("setxkbmap -layout 'us,ru' -variant 'colemak,' -option 'grp:caps_toggle,grp_led:caps'"). I still don't know how to combine its functions of modifier and layout switcher. – nikkou Nov 24 '13 at 6:00

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.