Change keyboard layout on Cinnamon Arch Linux or Cinnarch

The keyboard layout problem with Arch/Cinnarch Cinnamon DE

If you use the Cinnamon Desktop Environment with Arch Linux or Cinnarch and multiply keyboard layouts you may have problem when you are trying to change the keyboard layout.

With the latest Cinnamon update the keyboard layout indicator is visible with all layouts so you can change them from the indicator icon. Before this update the indicator was visible only if you had already change the layout with a shortcut. But changing the keyboard layout from the panel icon is not a solution.

The best solution for changing keyboard layouts is a keyboard shortcut. For Windows users the most common shortcut to change the keyboard layout is the Left Alt+Left Shift. I have Windows roots so I am used to change keyboard layout with Left Alt+Shift and I am still using Windows on various computers. So, I need a familiar solution.

But Cinnamon on Arch Linux and Cinnarch don’t permits you to use Alt+Shift. To make things worst you have to set 2 different shortcuts (one for next layout and one for previous layout) because with only one shortcut the layouts don’t cycle correct.

On Linux Mint 14 with Cinnamon DE you set only one shortcut for keyboard layout changes and you can use the Left Alt+Left Shift. You can also enable the shortcut Ctrl+Alt+Backspace to kill the X Server.

On Linux Mint 14 with Cinnamon DE you set only one shortcut for keyboard layout changes and you can use the Left Alt+Left Shift. You can also enable the shortcut Ctrl+Alt+Backspace to kill the X Server.

I am not sure if this is a bug of Cinnamon because Cinnamon in Linux Mint 14 needs only a shortcut for keyboard layout and allows you to use Left Alt+Shift.

So, how do I change the keyboard layout on Cinnamon at Arch Linux and Cinnarch?

The solution for me was a program at AUR, the qxkb. Its link in AUR is this https://aur.archlinux.org/packages/qxkb/ but its easier to install it with yaourt using the command

yaourt qxkb

The qxkb appears the current layout all the time and you can set any shortcuts you like (and ofc the Alt+Shift). It also let you set the Ctrl+Alt+Backspace shortcut for killing the X Server (something I didn’t find possible without qxkb). You can run automatically qxkb at login with two ways. The easiest is to run gnome-sessions-properties and add it there. The second is to create .desktop file and put it at ~/.config/autostart folder. Lets see them both.

1rst way

Open Terminal and run

gnome-sessions-properties

(Alternative you can select ‟Menu → Preferences → Startup Applications” if you have add it on your Menu)

From the Startup Applications window click ‟Add” and add the qxkb. The fields ‟Name” and ‟Comment” are only for information so complete them as you like. In the field ‟Command” write qxkb.

From the Startup Applications window click ‟Add” and add the qxkb.

From the Startup Applications window click ‟Add” and add the qxkb.

2n way

With the gedit or any other text editor you like create a file named qxkb.desktop and write:

[Desktop Entry]
Type=Application
GenericName=QXKB
Exec=/usr/bin/qxkb
Terminal=false
Name=QXKB

Copy this file in the folder ~/.config/autostart at your home user folder. If autostart folder does not exist create it. The folder .config is hidden so you must set the file manager to present the hidden files (usually with Ctrl+H).

Note

If you want to run manual the qxkb from your desktop add this line at qxkb.desktop file:

Icon=/usr/share/qxkb/theme/default/language/gr.png

and make the file executable. You can change the gr.png with your flag (check the folder /usr/share/qxkb/theme/default/language).

 

Configure qxkb

Run qxkb from menu and configure it.

QXKB Layout Options

From Layout Category Select ‟Enable keyboard layouts”. If you want to see country flags icons for the layout icon than check the ‟Show country flag” checkbox. From the ‟Available layouts” list select the layout you want and press the right arrow to copy this layout to the ‟Active layouts” list. Press the Save button to save your preferences.

To setup a shortcut for keyboard layout change you must go to the “Switching Options” category and select the Global switching policy. From there you can set the Left Alt+Left Shift shortcut. You can also set the shortcut Ctrl+Alt+Backspace to kill the X Server (click pictures to see details):

If you are going to use the qxkb than you must disable the Cinnamon Keyboard applet from the panel. To do this:

Remove-keyboard-layout-from-panelRight click the panel and select “Add applets to the panel”. Than, select the Keyboard applet, right click it and select “Remove all from panel”.

Remove-keyboard-layout-from-panel-02

That’s all. Now we can change keyboard layouts pressing the Left Alt+Left Shift…..

1 thought on “Change keyboard layout on Cinnamon Arch Linux or Cinnarch

Leave a Reply

Your email address will not be published. Required fields are marked *