Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

Following this answer I've installed xfce - xfce4-xkb-plugin to indicate and switch keyboard layouts in XUbuntu. But it resets all the settings (languages I use and a switch layouts hotkey) every time I reboot. How to make it to remember?

share|improve this question
add comment

7 Answers

up vote 3 down vote accepted

This is a known bug. I use xfce in arch linux and what I do is edit the ~/.config/xfce4/panel/xkb-plugin-##.rc and add a new line or something and it works for some sessions. Another temporary fix may be what #31 suggests

1. Set the desired options in the plugin
2. Copy the ~/.config/xfce4/panel/xkb-plugin-##.rc to some other file e.g. ~/.config/xfce4/panel/goodxkb.rc
3. Add this command to a startup job:

     sh -c "cp ~/.config/xfce4/panel/goodxkb.rc ~/.config/xfce4/panel/xkb-plugin-##.rc && pkill xkb"
    (change the ## to your number)

The pkill part is crucial to reload the plugin and its config.

share|improve this answer
    
How do you mean to add to "a startup job"? –  Ivan Dec 1 '11 at 0:49
    
add to your xfce autostart jobs in your session management –  sagarchalise Dec 1 '11 at 0:58
    
Oh, I've found that, thanks. –  Ivan Dec 1 '11 at 1:30
    
The solution has stopped working! It still helps to issue the command manually (in a terminal after XFCE boot), but the startup job fails to help (while present - I've checked). –  Ivan Dec 6 '11 at 17:03
add comment

As the best previous answer appears to be commented afterwards by the user as not working anymore, I will give here an updated perfected version of a quite successful workaround. Sorry not to be able to provide a more scientific less empirical approach, I am not an advanced user, just had the luck to get what I want in this case and want to share this, maybe as a temporary patchwork. So, bare with me. I use Xubuntu, maybe some instructions are limited to that.

My solution is this (my case is English-US as default, second French, third Romanian standard - replace accordingly):

  1. Go to Setting Manager - Keyboard - Layout, and set the languages in the preferred order (delete them and add them in order to achieve this). Go to the properties of the xkb plugin and make the same settings in the same order with the same default language.

  2. Open the file /home/your-username/.config/xfce4/xfconf/xfce-perchannel-xml/keyboard-layout.xml Edit it to look similar to this.

  3. Open the file home/username/.config/xfce4/panel/xkb-plugin-##.rc Edit it to look similar to this.

  4. Open the file (root) etc/default/keyboard

Edit it accordingly:

XKBMODEL="pc105"

XKBLAYOUT="us,fr,ro"

XKBVARIANT=",,std"

XKBOPTIONS="grp:alt_shift_toggle"

Maybe not all these are necessary to make it work, but just in case...

share|improve this answer
add comment

Xubuntu 12.04. I could get the shortcut remembered using the following actions:

  1. "Settings > Settings Manager > Keyboard > Layout" and uncheck the 'Use system defaults' in order to add new layouts;

  2. Go to the xfce4-xkb-plugin properties and set the short cut (I use Ctrl+Shift);

  3. Go back to "Settings > Settings Manager > Keyboard > Layout" and check the 'Use system defaults' (no worries, the keyboards added will be preserved).

This has survived 2 logouts/logins and one reboot, so far.

share|improve this answer
add comment

Menu -> Settings -> Settings Manager

Session and Startup

Check: Automatically save session on logout

share|improve this answer
1  
I don't want to save sessions. –  Ivan Dec 1 '11 at 0:43
    
to save sessions is not a solution for this –  cipricus Mar 16 '12 at 15:36
add comment

Just edit your /etc/default/keyboard the way you want. It works.

share|improve this answer
    
Cannot confirm this will suffice, for I edited other files to. But thanks for the tip. –  cipricus Mar 16 '12 at 15:25
add comment

I resolved this problem by adding on my .bashrc file this line:

setxkbmap -option grp:ctrl_shift_toggle

Everything work well now.

share|improve this answer
1  
This looks like specifying a language toggling keyboard shortcut but not the languages set. –  Ivan Oct 24 '12 at 8:57
add comment

Another solution is to use Debian's built-in tools :

  1. Settings -> input method switcher -> set to default
  2. Remove xfce4-xkb-plugin from the panel
  3. Run the command: sudo dpkg-reconfigure keyboard-configuration and choose the needed keyboard layout and hot key for switching
  4. Reboot
  5. Add xfce4-xkb-plugin to the panel if you wish
share|improve this answer
add comment

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.