This tip lets you switch quickly between two keyboard maps (languages).
setxkbmap is a tool to query and change the current XKB map. It is included in the package x11-xkb-utils which you can find in the repository.
Once setxkbmap is installed, run the following command in the terminal:
setxkbmap -option grp:switch,grp:alt_shift_toggle,grp_led:scroll us,ca
This command sets the key combination Alt-Shift to toggle the key map between us and ca (I am from Québec). For me it is inconvenient to run that command manually each time I want to switch between layouts. The solution is to create a .desktop file that includes that command. The .desktop file becomes an executable “application” that can be placed with the other .desktop files in the /usr/share/applications folder.
Here is the complete .desktop file, called “Keyboard-toggle.desktop”
[Desktop Entry] Name=Keyboard-toggle GenericName=Keyboard-toggle Comment=Toggle between 2 layouts with Alt-Shift Encoding=UTF-8 Exec=setxkbmap -option grp:switch,grp:alt_shift_toggle,grp_led:scroll us,ca Icon= Terminal=false Type=Application Categories= StartupNotify=false
After placing the .desktop file in the /usr/share/applications folder, you must add the file to the commands that run automatically when Bodhi starts up. To accomplish this, go to the Apps tab of the Settings panel, select Startup Applications, find keyboard-toggle in the list on the left, and add it to the list on the right.
If you want a key combo other than Alt-Shift, here are a few:
Options for switches between languages
Possible values grp_led:
If you would like to comment or make further suggestions, please leave a note on our Comments page (you will have to Create an Account if you haven't already).