Thomas' Tech Tips

Change keyboard layout in Linux from command-line

17 December 2022 - Thomas Damgaard

I recently had to use Kali Linux. I downloaded their pre-built virtualbox image. Problem is that I have Danish keyboard layout and Kali comes with US layout. Changing the Keyboard layout in Settings does not seem to work.

Luckily, this can be changed via command-line with this command:

setxkbmap -layout <country code>

For Danish layout this is:

setxkbmap -layout dk
Filed under: howto, linux, tips