Skip to content
Go to file
Cannot retrieve contributors at this time
25 lines (22 sloc) 892 Bytes
# This script makes it easier to change the keyboard layout on a raspberry pi. It will reboot your pi.
# Add execute permission on that file with the command chmod 755
# Then you can run the file with ./
# Look in this list to find the 2 character code for the country layout you want to use:
# Written by Niels Swinkels
# Free to use and modify by everyone. Use at your own risk.
echo "--------------------------------"
echo "Script to change keyboard layout"
echo "--------------------------------"
echo "Which layout should be used? tr=turkish, se=swedish, gb=english etc"
read layout
sudo sed -i 's|XKBLAYOUT=....|XKBLAYOUT="'$layout'"|g' /etc/default/keyboard
echo "Changed to"
grep "XKBLAYOUT" /etc/default/keyboard | sed 's/XKBLAYOUT=\(....\)/\1/g'
sleep 1
sudo reboot
exit 0
You can’t perform that action at this time.