Deutsch
Germany.ruФорумы → Архив Досок→ Linux & Co

scim

388  
voxel3d коренной житель20.09.09 18:51
voxel3d
20.09.09 18:51 
Сделал себе глобальный транслит:
sudo apt-get install scim

~/.xinitrc:

export XMODIFIERS=@im=SCIM
export GTK_IM_MODULE=xim
export QT_IM_MODULE=xim
scim -d &

Делаем свою таблицу трансляции:
translit+.txt.in:

### File header must not be modified
### This file must be encoded into UTF-8.
### This file is derived from GTK2 Input Method Cyrillic (Transliterated)
SCIM_Generic_Table_Phrase_Library_TEXT
VERSION_1_0
### Begin Table definition.
BEGIN_DEFINITION
### An unique id to distinguish this table among others.
### Use uuidgen to generate this kind of id.
UUID = e6fb3748-20bf-43d1-a10c-1763e0df129f
### A unique number indicates the version of this file.
### For example the last modified date of this file.
### This number must be less than 2^32.
SERIAL_NUMBER = 20090919
ICON = /usr/share/scim/icons/transplus.png
### The default name of this table
NAME = translit+
### The local names of this table
###NAME.ru_RU =
### Supported languages of this table
LANGUAGES = ru_RU
### The author of this table
AUTHOR = Alexander Sidorov <alx.sidorov@gmail.com>
### Prompt string to be displayed in the status area.
STATUS_PROMPT = tr+
### The Keyboard Layout used by this table. Unset or set to "Unknown" to accept any kind of layouts.
KEYBOARD_LAYOUT = Unknown
### If true then the first candidate phrase
### will be selected automatically during inputing.
AUTO_SELECT = TRUE
### If true then a multi wildcard will be appended
### at the end of inputing string automatically.
AUTO_WILDCARD = FALSE
### If true then the result string will be committed to client automatically.
### This should be used with AUTO_SELECT = TRUE.
AUTO_COMMIT = TRUE
### If true then the inputted string will be automatically splitted during inputing.
AUTO_SPLIT = TRUE
### If true then the phrases' frequencies will be adjusted dynamically.
DYNAMIC_ADJUST = FALSE
### If true then the preedit area will be filled up by the current candidate phrase automatically.
AUTO_FILL = TRUE
### If true then the lookup table will always be shown if there is any candidate phrase.
### Otherwise the lookup table won't be shown unless the user requires it by moving the preedit caret left.
ALWAYS_SHOW_LOOKUP = FALSE
### Enable full width punctuation property
USE_FULL_WIDTH_PUNCT = FALSE
### Use full width punctuation by default
DEF_FULL_WIDTH_PUNCT = FALSE
### Enable full width letter property
USE_FULL_WIDTH_LETTER = FALSE
### Use full width letter by default
DEF_FULL_WIDTH_LETTER = FALSE
### The maxmium length of a key.
MAX_KEY_LENGTH = 2
### Valid input chars.
VALID_INPUT_CHARS = ABWGDEVZIJKLMNOPRSTUFHCYX#'abwgdevzijklmnoprstufhcyx
### Single wildcard char, can have multiple chars.
###SINGLE_WILDCARD_CHAR = ?
### Multi wildcard char.
###MULTI_WILDCARD_CHAR = *
### The key strokes to split inputted string.
###SPLIT_KEYS = quoteright
### The key strokes to commit the convert result to client.
COMMIT_KEYS = Shift+space
### The key strokes to forward the inputted string to client.
FORWARD_KEYS = Return
### The key strokes to select candidiate phrases.
SELECT_KEYS = 1,2,3,4,5,6,7,8,9
### The key strokes to page up the lookup table.
PAGE_UP_KEYS = Page_Up
### The key strokes to page down the lookup table.
PAGE_DOWN_KEYS = Page_Down
END_DEFINITION
### Begin Table data.
BEGIN_TABLE
A А 0
B Б 0
V В 0
G Г 0
D Д 0
E Е 0
JO Ё 0
Jo Ё 0
ZH Ж 0
Zh Ж 0
Z З 0
I И 0
J Й 0
K К 0
L Л 0
M М 0
N Н 0
O О 0
P П 0
R Р 0
S С 0
T Т 0
U У 0
F Ф 0
H Х 0
C Ц 0
CH Ч 0
Ch Ч 0
Sh Ш 0
SH Ш 0
W Щ 0
Shh Щ 0
SHh Щ 0
SHH Щ 0
## Ъ 0
Y Ы 0
'' Ь 0
Je Э 0
JE Э 0
JU Ю 0
Ju Ю 0
Ja Я 0
JA Я 0
a а 0
b б 0
v в 0
g г 0
d д 0
e е 0
jo ё 0
zh ж 0
z з 0
i и 0
j й 0
k к 0
l л 0
m м 0
n н 0
o о 0
p п 0
r р 0
s с 0
t т 0
u у 0
f ф 0
h х 0
c ц 0
ch ч 0
sh ш 0
w щ 0
# ъ 0
y ы 0
' ь 0
je э 0
ju ю 0
ja я 0
END_TABLE

компилируем:

scim-make-table translit+.txt.in -b -o translit+.bin

Закидываем получившийся бинарник в /usr/share/scim/tables, тырим / рисуем сами / берём из аттача к сообщению иконку, закидываем её в /usr/share/scim/icons, перезагружаем иксы. Если WM кошерный, находим в трее запущенный ским, открываем сетап снимаем все биндинги кроме ctrl+space на переключение раскладок, дизейблим все раскладки, оставляем новую translit+. Вуаля, контрол + спейс делают нам везде транслит.
p.s. если делаем свой транслит (я сделал аналог с translit.ru) обращаем внимание в файле на поле UUID = ..., используем uuidgen для генерации значения, на поле SERIAL_NUMBER = ... и на поле VALID_INPUT_CHARS = ...

Dropbox - средство синхронизации и бэкапа файлов.
#1 
  Chipolino старожил20.09.09 20:47
NEW 20.09.09 20:47 
в ответ voxel3d 20.09.09 18:51
а в чем приемущество перед дополнительной раскладкой ?
#2 
  дактиль падчерица20.09.09 21:22
NEW 20.09.09 21:22 
в ответ voxel3d 20.09.09 18:51
Это твой блог в автоподписи ?
#3 
voxel3d коренной житель20.09.09 21:40
voxel3d
NEW 20.09.09 21:40 
в ответ Chipolino 20.09.09 20:47
В том, что существующая фонетическая раскладка отличается от транслит.ру, к которому за последние несколько лет привык. -)
В ответ на:
Это твой блог в автоподписи ?

на блог это вряд ли потянет, я там про имакс складирую писанину. Настройки линукса буду ещё скидывать.
Dropbox - средство синхронизации и бэкапа файлов.
#4 
  Chipolino старожил20.09.09 21:42
NEW 20.09.09 21:42 
в ответ voxel3d 20.09.09 21:40
Ясно.
Меня фонетическая устраивает :-)
#5 
  дактиль падчерица20.09.09 21:50
NEW 20.09.09 21:50 
в ответ voxel3d 20.09.09 21:40, Последний раз изменено 20.09.09 21:52 (дактиль)
В ответ на:
на блог это вряд ли потянет, я там про имакс складирую писанину. Настройки линукса буду ещё скидывать.

Вот и я хочу себе такое завести, для мелочей. Писанину свою я скидываю на гэ-мыло, а такое вот для всяких полезных штуковин, например как настроить шрифты в фф, мне будет в самый раз :).
#6 
voxel3d коренной житель20.09.09 22:43
voxel3d
NEW 20.09.09 22:43 
в ответ дактиль 20.09.09 21:50
ну, гугльблог, а у меня он, лучше подходит для этой цели, чем мыло.
Dropbox - средство синхронизации и бэкапа файлов.
#7 
voxel3d коренной житель22.09.09 14:20
voxel3d
NEW 22.09.09 14:20 
в ответ voxel3d 20.09.09 18:51
Небольшое дополнение. В GNOME требуется в Система -> Администрирование -> Локализации включить "Использовать IME для ввода сложных символов", чтобы оно заработало.
Dropbox - средство синхронизации и бэкапа файлов.
#8