Shortcut for switching between keyboard layouts (languages)?

Forum rules
Before you post please read this

Shortcut for switching between keyboard layouts (languages)?

Postby beansandjeans on Tue Jan 01, 2013 6:11 pm

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.

All help much appreciated! Thanks :-)
beansandjeans
Level 3
Level 3
 
Posts: 116
Joined: Tue Feb 23, 2010 3:12 pm

Linux Mint is funded by ads and donations.
 

Re: Shortcut for switching between keyboard layouts (languag

Postby beansandjeans on Sat Jan 05, 2013 8:38 pm

UPDATE:

Nobody had replied here, so I did a bit more digging and finally found a thread on a PC Linux forum which discussed this: http://www.pclinuxos.com/forum/index.php?topic=95438.0

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! :-)
beansandjeans
Level 3
Level 3
 
Posts: 116
Joined: Tue Feb 23, 2010 3:12 pm

Re: Shortcut for switching between keyboard layouts (languag

Postby nissimnanach on Mon Jan 14, 2013 4:18 pm

LINUX MINT 14: LEFT SHIFT + CAPS LOCK is default

Change default by:
1. Right-click on keyboard language indicator in right
2. Select "Layouts" tab
3. Options: KEYS TO CHANGE LAYOUT
Nissim Solutions
nsol.altervista.org
nissimnanach
Level 1
Level 1
 
Posts: 6
Joined: Mon Jan 14, 2013 4:08 pm

Re: Shortcut for switching between keyboard layouts (languag

Postby OxidE on Wed Jan 16, 2013 9:38 am

Can someone explain in simple way how to change keyboard languages with alt+unicorns combination?
OxidE
Level 1
Level 1
 
Posts: 1
Joined: Wed Jan 16, 2013 5:52 am

Re: Shortcut for switching between keyboard layouts (languag

Postby dman on Sat Jan 19, 2013 5:26 pm

In xfce, this works:

Code: Select all
setxkbmap -option grp:alt_shift_toggle "de,us"



That's to switch between English-US and German-DE on the command line using Alt+Shift.

I'm trying to figure out where to put that for a permanent setting. I know where in Lubuntu, but that path and file are not applicable to xfce.

/dman
dman
Level 1
Level 1
 
Posts: 27
Joined: Sat May 05, 2012 9:28 am

Re: Shortcut for switching between keyboard layouts (languag

Postby yarlipo on Wed Mar 13, 2013 5:48 pm

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.

That's it! Now your linux mint install remembers the toggle between sessions.
yarlipo
Level 1
Level 1
 
Posts: 1
Joined: Wed Mar 13, 2013 5:43 pm

Re: Shortcut for switching between keyboard layouts (languag

Postby gikos on Mon Mar 25, 2013 3:09 am

really helpful for newbies.
thanks a lot.
gikos
Level 1
Level 1
 
Posts: 1
Joined: Mon Mar 25, 2013 3:05 am

Re: Shortcut for switching between keyboard layouts (languag

Postby cipricus on Thu Apr 11, 2013 1:28 pm

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

111.png
xfce4-xkb-plugin layouts list in panel
111.png (12.91 KiB) Viewed 12098 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.)

2222.png
cipricus
Level 1
Level 1
 
Posts: 3
Joined: Fri Feb 08, 2013 8:23 am

Re: Shortcut for switching between keyboard layouts (languag

Postby fazecasciprian on Wed Jul 17, 2013 7:14 pm

regional settings -->layouts-->options-->key(s) to change layout-->select and close
fazecasciprian
Level 1
Level 1
 
Posts: 1
Joined: Wed Jul 17, 2013 7:10 pm

Linux Mint is funded by ads and donations.
 

Return to XFCE

Who is online

Users browsing this forum: No registered users and 0 guests