Source: https://superuser.com/questions/1147320/how-to-change-keyboard-layout-in-i3
Execute this commands
setxkbmap -layout us,de setxkbmap -option 'grp:alt_shift_toggle'
Or put this on your i3 config file (~/.i3/config, ~/.config/i3/config…)
exec "setxkbmap -layout us,de" # optionsl exec "setxkbmap -option 'grp:alt_shift_toggle'"