I needed a way to make sure that, when a certain application is launched, the keyboard layout is pre-selected to be il. My first attempt was to do the following with setxkbmap:
setxkbmap il ; applicationI was rather amused to find that I couldn't get back to the us layout...
Here's how I do it now, that I've learned my lesson:
setxkbmap "il+us:2" ; application ; setxkbmap "us+il:2"