My current keyboard config is quite complex, but the relevant line is:
setxkbmap -option -option 'grp:rshift_toggle, compose:rctrl' dmru,ru,ua &
Rshift now cycles through dmru, ru, and ua. When my screen gets locked, I have no way of knowing which layout am I using to type my password, and in general it would be awesome to have a shortcut which takes me back to english. (dmru in this case, it's a custom layout.) I can't run setxkbmap $language at every switch because it breaks my xcape and xmodmap settings; running them every time takes a couple of seconds and is not practical.
Would it be possible to switch to a particular language, without running setxkbmap every time?