[NOTE]Changing Keyboard Layout on #Ubuntu 18.04 Permanently

Krishnendu Paul

Sep 11, 2020 1 min read


I always used en-US keyboard as that is what I use to get in India. After shifting to Sweden, main problem was to adopt with Swedish layout keyboard. But, that happened swiftly. Then, the issue was keymap. If you are downloading a ready-made Virtual Machine image, it is always preloaded with en-US keymap. Also, I always forgot what step I followed previously to change it to Swedish.

So, here is the quick hack for my personal note

L='se' && sudo sed -i 's/XKBLAYOUT=\"\w*"/XKBLAYOUT=\"'$L'\"/g' /etc/default/keyboard && echo "setxkbmap se" >> ~/.bashrc

Change 'se' part to 'us' to go back to en-US keymap.



Great! You've successfully subscribed.
Great! Next, complete checkout for full access.
Welcome back! You've successfully signed in.
Success! Your account is fully activated, you now have access to all content.