суббота, 13 октября 2012 г.

Tuning keyboard in Xubuntu

In recent years, Ubuntu became very popular desktop environment with large user base. But their new invention called Unity caused a bit of split. Some people try to stand it, some try to beat systems into a shape by recovering Gnome parts, and some, like me, switched to a different *ubuntu flavor. Xubuntu uses Xfce desktop environment which is very fast, compact and have almost zero bloat. This also means that average user will encounter some problems with fine tuning of some aspects. This time we'll look at keyboard setup.

Default keyboard setup of freshly installed Xubuntu wasn't acceptable at all:
  • no language indicator;
  • shift key have no effect on numeric keyboard;
  • CapsLock key doesn't mapped to Control key.
The first item solved by adding "Keyboard Layouts" plugin to the appropriate panel. If it is missing, install xfce4-kxb-plugin.

As the old keyboard user, I'm use cursor movement, Insert and Del keys located on the numeric keyboard. By default, shift key do not allow to perform selection, copy or paste operations and merely enters corresponding numbers. Documentation suggests us to use /etc/default/keyboard file and modify XKBOPTIONS variable:

XKBOPTIONS="grp:ctrl_shift_toggle,grp_led:scroll,numpad:microsoft"

Execute

udevadm trigger --subsystem-match=input --action=change

command to apply changes. Everything works fine now. Try to reboot or logout and login again - test keys and now everything reverted back. This due to limitations in the "Keyboard Layouts" plugin, but thanks to it's author, things can be fixed. Logout once again, press Ctrl-Alt-F2 to reach console, login, locate ~/.config/xfce4/panel/xkb=plugin-*.rc file (* means that there can be any number) and add the following line to it:

never_modify_config=true

Switch back to the login prompt by pressing Alt-F7 and login into your session. Check keys - everything should work fine again.

Not all applications will recognize  Shift-Insert and Shift-Delete key combinations pressed on numeric keypad. This is due to the fact, that these keys have different keycodes. We can fix this by creating ~/.Xmodmap file with the following content:

keysym KP_Insert = Insert
keysym KP_Delete = Delete


it will be processed on subsequent login, to apply changes immediately run

xmodmap ~/.Xmodmap

And finally, lets make useless CapsLock key to act as Control key. To do this, open /etc/default/keyboard again and modify XKBOPTIONS line:

XKBOPTIONS="grp:ctrl_shift_toggle,grp_led:scroll,numpad:microsoft,ctrl:nocaps"

Apply changes as described above, and enjoy the easily reachable Control key.

Комментариев нет:

Отправить комментарий