Sunday, February 26, 2012

How to make the Xfce xkb keyboard layout plugin to remember settings after reboot.

I found two files involved in this: /home/user/.config/xfce4/xfconf/xfce-perchannel-xml/keyboard-layout.xml and /home/user/.config/xfce4/panel/xkb-plugin-43.rc (the last number varies in the name) I have seen that the second has the options that are created when you change settings, but these are not saved on session logout. So the other one has to be edited.

First make the desired settings in Settings Manager/Keyboard and in the plugin options. Then edit the two files mentioned so as to have the same options. In fact the xml file is the one that contains the data to be loaded after logout, but it does not contain the shortcut to change layout. Anyway, this shortcut will be remembered if the other data in the rc file are not different from those in the xml file.

The file xkb-plugin-43.rc should look like this:
display_type=1
group_policy=2
default_group=1
never_modify_config=false
model=pc105
layouts=ro,us,fr
variants=std,,
toggle_option=grp:alt_caps_toggle
compose_key_position=

The keyboard-layout.xml should look like this:
<?xml version="1.0" encoding="UTF-8"?>

<channel name="keyboard-layout" version="1.0">
  <property name="Default" type="empty">
    <property name="XkbDisable" type="bool" value="false"/>
    <property name="XkbLayout" type="string" value="ro,us,fr"/>
    <property name="XkbVariant" type="string" value=",std"/>
  </property>
</channel>

No comments:

Post a Comment