So I recently installed Mint 13 XFCE on a netbook, and this computer is shared with someone who uses the German keyboard layout. I have both keyboard layouts (German and US English) set-up, but the process of switching between them is somewhat tedious - I have to go into the keyboard settings menu, and from there to the layout tab, and then switch from one language to the other. I put a shortcut to this menu on the desktop, so at least I don't have to navigate through the menu to get to it, but it's still rather tedious.

This is the first time I've worked used multiple keyboard layouts on a Linux computer. On Windows it was always just a matter of Alt-Shift.

So I'm wanting to know if there's any existing shortcut that could be used, or if one could be set up...

In that same keyboard menu there's an "application shortcuts" tab, and I've made a new shortcut already for an application, but I imagine this might also work for other keyboard shortcuts in general. But for that I need a command, and I don't know what the command is to switch between keyboard layouts. I hope there is one, and preferably one that can be used to toggle it in either direction (the same command to switch from English to German and vice versa), but if has to be two separate commands that's not a big deal.

One of the replies gave this command: "setxkbmap XX" (excluding the quotation marks), with the "XX" for the keyboard layout language.

So for the shortcuts then, "setxkbmap de" ended up working for German. "setxkbmap en" DOESN'T work for English, but "setxkbmap us" did, and I would imagine similar commands for other variants would as well, like "setxkbmap uk" for the UK English layout.

I'm not sure if these commands also work in Gnome/MATE or other environments, or if they're just for XFCE.

Also still don't know if there's one command that would toggle it in both directions. If anyone knows if that's possible, please let me know...

But at least it's working a lot better now than having to go into the menu each time!

It amazes me that Linux Mint doesn't have a built in solution for toggling languages. Nevertheless, I used the solution posted above, and I figured out a way to store it between sessions. Hopefully people can find this straight away, it took me days to find a solution.

Go to Menu - Settings - Session and Startup. Chose application autostart. Click on add. Fill in the first two lines with whatever you prefer, and then in the Command field paste the code dman kindly provided:

setxkbmap -option grp:alt_shift_toggle "de,us"

replacing de and us with your own language code.

Note that the language mentioned first will be activated as the default language when you boot.

nissimnanach's answer is the good one, although it refers to Xfce 14 Nadia: in 13 Maya things are the same, as it already includes Xfce version 4.10

The solution seemed so obvious that the only explanation i imagined for the reportred problem was that the keyboard layout app was not added to the panel and therefore was not there to be seen.

I really do not understand how come "Linux Mint doesn't have a built in solution for toggling languages"! It has.

First be sure that the xfce4-xkb-plugin is visible on the Xfce panel: right click on the panel, 'Panel/Add new items' and search for 'Keyboard Layouts'. After that the list of keyboard layouts is displayed there, and you can select the one you want

xfce4-xkb-plugin layouts list in panel

111.png (12.91 KiB) Viewed 15438 times

(so, there's no need to "go into the keyboard settings menu, and from there to the layout tab, and then switch from one language to the other" - as the author of the question says.)

To set shortcut, right-click on the panel applet and in Properties there's the option of setting Alt-Shift or anything you want, under 'Change layout option'.

(By the way, it is better to set Right-Alt under 'Compose key position', or the AltGr key might not work under Wine.)