XKB Layout customisation

27 views
Skip to first unread message

"Oleg Anisimov (Олег Анисимов)"

unread,
Mar 18, 2008, 8:30:16 AM3/18/08
to
Доброго всем LOCAL_TIME!

Захотелось наконец-то сделать себе "включатели" раскладок, кои
обсуждались здесь в нескольких тредах. Перечитал рассказ Ивана
Паскаля, полистал рассылку. Вроде в голове что-то сформировалось
и приступил к делу. Что я сделал?

1. В домашней директории создал файл .xkbgroup.my содержащий
все строки из /usr/share/X11/xkb/symbols/group плюс это:

// the right alt key locks the last group
// the right control key locks the first group
//
partial modifier_keys
xkb_symbols "rac_select" {
virtual_modifiers AltGr;
key <RALT> {
symbols[Group1]= [ ISO_Last_Group ],
virtualMods= AltGr
};
key <RCTL> { [ ISO_First_Group ] };
};

2. Там же, в домашней, создал файл .xkb.my, содержащий:

xkb_keymap "rac_104" {
xkb_keycodes { include "xfree86" };
xkb_symbols {
include "us"
include "ru(winkeys)"
include ".xkbgroup.my(rac_select)"
};
xkb_geometry { include "pc(pc104)" };
};

3. Перед тем, как прописать запуск xkbcomp в .xsession проверяю
работу этой конструкции из командной строки:

yoda@yoda:~$ /usr/bin/X11/xkbcomp /home/yoda/.xkb 0.0
Warning: Type "ALPHABETIC" is not defined
Using TWO_LEVEL for the <TLDE> key (keycode 49)
Ошибка сегментирования

И все... Приплыли. Может кто подскажет что я не так делаю?

--
--
С наилучшими пожеланиями,
Олег Анисимов AKA Yoda


--
To UNSUBSCRIBE, email to debian-russ...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listm...@lists.debian.org

Artem Chuprina

unread,
Mar 21, 2008, 10:10:12 AM3/21/08
to
Oleg Anisimov (Олег Анисимов) -> debian-russian @ Tue, 18 Mar 2008 15:25:50 +0300:

OA(А> 1. В домашней директории создал файл .xkbgroup.my содержащий
OA(А> все строки из /usr/share/X11/xkb/symbols/group плюс это:

OA(А> // the right alt key locks the last group
OA(А> // the right control key locks the first group
OA(А> //
OA(А> partial modifier_keys
OA(А> xkb_symbols "rac_select" {
OA(А> virtual_modifiers AltGr;
OA(А> key <RALT> {
OA(А> symbols[Group1]= [ ISO_Last_Group ],
OA(А> virtualMods= AltGr
OA(А> };
OA(А> key <RCTL> { [ ISO_First_Group ] };
OA(А> };

OA(А> 2. Там же, в домашней, создал файл .xkb.my, содержащий:

OA(А> xkb_keymap "rac_104" {
OA(А> xkb_keycodes { include "xfree86" };
OA(А> xkb_symbols {
OA(А> include "us"
OA(А> include "ru(winkeys)"
OA(А> include ".xkbgroup.my(rac_select)"
OA(А> };
OA(А> xkb_geometry { include "pc(pc104)" };
OA(А> };

У меня аналогичный файл выглядит так:

xkb_keymap "ran_105" {
xkb_keycodes {
include "xfree86"
};
xkb_types { include "complete" };
xkb_compatibility { include "complete" };
xkb_symbols {
include "pc(pc105)"
include "us"
include "ru(winkeys):2"
include "group-rich(switch)"
include "group-rich(lsgt_switch)"
include "group-rich(caps_select)"
include "compose(rctrl)"
};
xkb_geometry { include "pc(pc105)" };
};

Обращаю внимание на наличие xkb_types и xkb_compatibility, include
"pc(pc105)" в разделе symbols (это не тот же самый файл, что в разделе
geometry) и на :2 у ru. Ну, у тебя под 104 клавиши, а не под 105 во
всех случаях.

OA(А> 3. Перед тем, как прописать запуск xkbcomp в .xsession проверяю
OA(А> работу этой конструкции из командной строки:

OA(А> yoda@yoda:~$ /usr/bin/X11/xkbcomp /home/yoda/.xkb 0.0
OA(А> Warning: Type "ALPHABETIC" is not defined
OA(А> Using TWO_LEVEL for the <TLDE> key (keycode 49)
OA(А> Ошибка сегментирования

И не 0.0, а :0.0. Вернее, $DISPLAY, а оно уже само разберется, кто у
тебя дисплей.

--
Artem Chuprina
RFC2822: <ran{}ran.pp.ru> Jabber: r...@jabber.ran.pp.ru

Все учтено могучим ураганом...

"Oleg Anisimov (Олег Анисимов)"

unread,
Mar 24, 2008, 6:30:20 AM3/24/08
to
Artem Chuprina пишет:

> У меня аналогичный файл выглядит так:
>
> xkb_keymap "ran_105" {
> xkb_keycodes {
> include "xfree86"
> };
> xkb_types { include "complete" };
> xkb_compatibility { include "complete" };
> xkb_symbols {
> include "pc(pc105)"
> include "us"
> include "ru(winkeys):2"
> include "group-rich(switch)"
> include "group-rich(lsgt_switch)"
> include "group-rich(caps_select)"
> include "compose(rctrl)"
> };
> xkb_geometry { include "pc(pc105)" };
> };
>
Поправил, теперь выглядит вот так:
xkb_keymap "rac_104" {

xkb_keycodes { include "xfree86" };
xkb_types { include "complete" };
xkb_compatibility { include "complete" };
xkb_symbols {
include "pc(pc104)"

include "us"
include "ru(winkeys):2"
include ".xkbgroup.my(rac_select)"
};
xkb_geometry { include "pc(pc104)" };
};

> Обращаю внимание на наличие xkb_types и xkb_compatibility, include
> "pc(pc105)" в разделе symbols (это не тот же самый файл, что в разделе
> geometry) и на :2 у ru. Ну, у тебя под 104 клавиши, а не под 105 во
> всех случаях.

Просто посчитал. что сработает default значения.


>
> И не 0.0, а :0.0. Вернее, $DISPLAY, а оно уже само разберется, кто у
> тебя дисплей.
>

После исправлений:

yoda@yoda:~$ /usr/bin/X11/xkbcomp /home/yoda/.xkb.my $DISPLAY
expected keysym, got XF86KbdLightOnOff: line 70 of pc
last scanned symbol is: XF86KbdLightOnOff
expected keysym, got XF86KbdBrightnessDown: line 71 of pc
last scanned symbol is: XF86KbdBrightnessDown
expected keysym, got XF86KbdBrightnessUp: line 72 of pc
last scanned symbol is: XF86KbdBrightnessUp
Error: No Symbols named "pc104" in the include file "pc"
Exiting
Abandoning symbols file "rac_104"
Error: success in unknown
Couldn't write keyboard description to :0

В файле /usr/share/X11/xkb/symbols/pc и вправду нет секции pc104,
pc105 присутствует. Сижу на тестинге. Посмотрел на машине с etch,
там эта секция есть и всего лишь содержит:

xkb_symbols "pc104" {
include "pc"
};

Бага? Или так задумано?

--
--
С наилучшими пожеланиями,
Олег Анисимов AKA Yoda

"Oleg Anisimov (Олег Анисимов)"

unread,
Mar 24, 2008, 9:10:26 AM3/24/08
to
Oleg Anisimov (Олег Анисимов) пишет:

> В файле /usr/share/X11/xkb/symbols/pc и вправду нет секции pc104,
> pc105 присутствует. Сижу на тестинге. Посмотрел на машине с etch,
> там эта секция есть и всего лишь содержит:
>
> xkb_symbols "pc104" {
> include "pc"
> };
>
> Бага? Или так задумано?
>
В общем подправив xkb_compatibility, исправив include "pc(pc104)"
на include "pc(pc105)", удалось заставить работать включалки.
Единственное, что смущает, - ругань в консоли при старте:

yoda@yoda:~$ /usr/bin/X11/xkbcomp /home/yoda/.xkb.my $DISPLAY
expected keysym, got XF86KbdLightOnOff: line 70 of pc
last scanned symbol is: XF86KbdLightOnOff
expected keysym, got XF86KbdBrightnessDown: line 71 of pc
last scanned symbol is: XF86KbdBrightnessDown
expected keysym, got XF86KbdBrightnessUp: line 72 of pc
last scanned symbol is: XF86KbdBrightnessUp

Warning: No symbols defined for <SYRQ> (keycode 92)
Warning: No symbols defined for <II65> (keycode 101)
Warning: No symbols defined for <BRK> (keycode 114)
Warning: No symbols defined for <FK13> (keycode 118)
Warning: No symbols defined for <FK14> (keycode 119)
Warning: No symbols defined for <FK15> (keycode 120)
Warning: No symbols defined for <FK16> (keycode 121)
Warning: No symbols defined for <FK17> (keycode 122)
Warning: No symbols defined for <KPDC> (keycode 123)
Warning: No symbols defined for <XFER> (keycode 129)
Warning: No symbols defined for <I02> (keycode 130)
Warning: No symbols defined for <NFER> (keycode 131)
Warning: No symbols defined for <I04> (keycode 132)
Warning: No symbols defined for <AE13> (keycode 133)
Warning: No symbols defined for <I06> (keycode 134)
Warning: No symbols defined for <I07> (keycode 135)
Warning: No symbols defined for <I08> (keycode 136)
Warning: No symbols defined for <I09> (keycode 137)
Warning: No symbols defined for <I0A> (keycode 138)
Warning: No symbols defined for <I0B> (keycode 139)
Warning: No symbols defined for <I0C> (keycode 140)
Warning: No symbols defined for <I0D> (keycode 141)
Warning: No symbols defined for <I0E> (keycode 142)
Warning: No symbols defined for <I0F> (keycode 143)
Warning: No symbols defined for <I10> (keycode 144)
Warning: No symbols defined for <I11> (keycode 145)
Warning: No symbols defined for <I12> (keycode 146)
Warning: No symbols defined for <I13> (keycode 147)
Warning: No symbols defined for <I14> (keycode 148)
Warning: No symbols defined for <I15> (keycode 149)
Warning: No symbols defined for <I16> (keycode 150)
Warning: No symbols defined for <I17> (keycode 151)
Warning: No symbols defined for <I18> (keycode 152)
Warning: No symbols defined for <I19> (keycode 153)
Warning: No symbols defined for <I1A> (keycode 154)
Warning: No symbols defined for <I1B> (keycode 155)
Warning: No symbols defined for <K59> (keycode 157)
Warning: No symbols defined for <I1E> (keycode 158)
Warning: No symbols defined for <I1F> (keycode 159)
Warning: No symbols defined for <I20> (keycode 160)
Warning: No symbols defined for <I21> (keycode 161)
Warning: No symbols defined for <I22> (keycode 162)
Warning: No symbols defined for <I23> (keycode 163)
Warning: No symbols defined for <I24> (keycode 164)
Warning: No symbols defined for <I25> (keycode 165)
Warning: No symbols defined for <I26> (keycode 166)
Warning: No symbols defined for <I27> (keycode 167)
Warning: No symbols defined for <I28> (keycode 168)
Warning: No symbols defined for <I29> (keycode 169)
Warning: No symbols defined for <K5A> (keycode 170)
Warning: No symbols defined for <I2B> (keycode 171)
Warning: No symbols defined for <I2C> (keycode 172)
Warning: No symbols defined for <I2D> (keycode 173)
Warning: No symbols defined for <I2E> (keycode 174)
Warning: No symbols defined for <I2F> (keycode 175)
Warning: No symbols defined for <I30> (keycode 176)
Warning: No symbols defined for <I31> (keycode 177)
Warning: No symbols defined for <I32> (keycode 178)
Warning: No symbols defined for <I33> (keycode 179)
Warning: No symbols defined for <I34> (keycode 180)
Warning: No symbols defined for <K5B> (keycode 181)
Warning: No symbols defined for <K5D> (keycode 182)
Warning: No symbols defined for <K5E> (keycode 183)
Warning: No symbols defined for <K5F> (keycode 184)
Warning: No symbols defined for <I39> (keycode 185)
Warning: No symbols defined for <I3A> (keycode 186)
Warning: No symbols defined for <I3B> (keycode 187)
Warning: No symbols defined for <I3C> (keycode 188)
Warning: No symbols defined for <K62> (keycode 189)
Warning: No symbols defined for <K63> (keycode 190)
Warning: No symbols defined for <K64> (keycode 191)
Warning: No symbols defined for <K65> (keycode 192)
Warning: No symbols defined for <K66> (keycode 193)
Warning: No symbols defined for <I42> (keycode 194)
Warning: No symbols defined for <I43> (keycode 195)
Warning: No symbols defined for <I44> (keycode 196)
Warning: No symbols defined for <I45> (keycode 197)
Warning: No symbols defined for <K67> (keycode 198)
Warning: No symbols defined for <K68> (keycode 199)
Warning: No symbols defined for <K69> (keycode 200)
Warning: No symbols defined for <K6A> (keycode 201)
Warning: No symbols defined for <I4A> (keycode 202)
Warning: No symbols defined for <K6B> (keycode 203)
Warning: No symbols defined for <K6C> (keycode 204)
Warning: No symbols defined for <K6D> (keycode 205)
Warning: No symbols defined for <K6E> (keycode 206)
Warning: No symbols defined for <K6F> (keycode 207)
Warning: No symbols defined for <HKTG> (keycode 208)
Warning: No symbols defined for <KANA> (keycode 209)
Warning: No symbols defined for <EISU> (keycode 210)
Warning: No symbols defined for <AB11> (keycode 211)
Warning: No symbols defined for <I54> (keycode 212)
Warning: No symbols defined for <I55> (keycode 213)
Warning: No symbols defined for <I5A> (keycode 218)
Warning: No symbols defined for <K74> (keycode 219)
Warning: No symbols defined for <K75> (keycode 220)
Warning: No symbols defined for <K76> (keycode 221)
Warning: No symbols defined for <I5E> (keycode 222)
Warning: No symbols defined for <I5F> (keycode 223)
Warning: No symbols defined for <I60> (keycode 224)
Warning: No symbols defined for <I61> (keycode 225)
Warning: No symbols defined for <I62> (keycode 226)
Warning: No symbols defined for <I63> (keycode 227)
Warning: No symbols defined for <I64> (keycode 228)
Warning: No symbols defined for <I65> (keycode 229)
Warning: No symbols defined for <I66> (keycode 230)
Warning: No symbols defined for <I67> (keycode 231)
Warning: No symbols defined for <I68> (keycode 232)
Warning: No symbols defined for <I69> (keycode 233)
Warning: No symbols defined for <I6A> (keycode 234)
Warning: No symbols defined for <I6B> (keycode 235)
Warning: No symbols defined for <I6C> (keycode 236)
Warning: No symbols defined for <I6D> (keycode 237)
Warning: No symbols defined for <I6E> (keycode 238)
Warning: No symbols defined for <I6F> (keycode 239)
Warning: No symbols defined for <I70> (keycode 240)
Warning: No symbols defined for <I71> (keycode 241)
Warning: No symbols defined for <I72> (keycode 242)
Warning: No symbols defined for <I73> (keycode 243)
Warning: No symbols defined for <I74> (keycode 244)
Warning: No symbols defined for <I75> (keycode 245)
Warning: No symbols defined for <I76> (keycode 246)
Warning: No symbols defined for <I77> (keycode 247)
Warning: No symbols defined for <I78> (keycode 248)
Warning: No symbols defined for <I79> (keycode 249)
Warning: No symbols defined for <I7A> (keycode 250)
Warning: No symbols defined for <I7B> (keycode 251)
Warning: No symbols defined for <I7C> (keycode 252)
Warning: No symbols defined for <I7D> (keycode 253)
Warning: No symbols defined for <I7E> (keycode 254)
Warning: No symbols defined for <I7F> (keycode 255)

Хотя глюков (пока) не замечено. "Сбылась мечта идиота" (с). 8)

Reply all
Reply to author
Forward
0 new messages