Let's look at one way to change the keyboard language in FreeBSD based on a small script.
So create a file with any name, for me it is KeyLumina.sh and add to it the following lines:
setxkbmap -layout "us,ua" -option "grp:alt_shift_toggle,grp_led:scroll"
If you need russian, but why do you need it, add in quotes ru after the comma.
To start the script automatically, you can add the following to the cron:
If the desktop environment you are using allows you to autorun scripts but does not have its own keyboard switching facility then you can also use this method.
Make sure to make the file executable by using this command:
chmod a+x /home/user/..../KeyLumina.sh