Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I want to create a bash script that adds the "French (Canada)" keyboard layout. In addition, I would like to set Alt+Shift as the keys used to change layout.

share|improve this question

1 Answer 1

up vote 1 down vote accepted

You have setxkbmap to change the keyboard layout. For the "French (Canada)" layout, it's setxkbmap fr-legacy (I find it with cat /usr/share/X11/xkb/rules/base.lst | grep fr)

So you can put that in a bash script.

And to add a shortcut, you can add it in Keyboard → Shortcut (in the System configuration board).

share|improve this answer
    
Is there a way to add the shortcut via command-line? –  Gradient Feb 4 '13 at 6:38
    
From the Ubuntu wiki : gsettings set org.gnome.desktop.wm.keybindings switch-windows "['<Alt>Tab']" to make Alt-Tab the shortcut to switch windows for instance. And you will have to edit a file in /usr/share/gnome-control-center/keybindings/ to add your action. –  Dorian Feb 5 '13 at 20:04

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.