Главная Форум Wiki Почта Jabber Devel NIX-FILES
Материал из AltLUG Wiki
Перейти к: навигация, поиск

UTF-8 консоль в Gentoo

Содержание

Установка экранного шрифта

Экранный шрифт, загружаемый по умолчанию, определяется в файле /etc/conf.d/consolefont.

 CONSOLEFONT="default8x16"

Для вывода русских букв, значение по умолчанию следует заменить на имя какого-либо файла шрифта с поддержкой кириллицы. Файлы шрифтов распологаются в каталоге /usr/share/consolefonts/. Для кодировки UTF-8 лучше всего использовать шрифты terminus.

 emerge terminus

Правим /etc/conf.d/consolefont

 # CONSOLEFONT specifies the default font that you'd like Linux to use on the
 # console.  You can find a good selection of fonts in /usr/share/consolefonts;
 # you shouldn't specify the trailing ".psf.gz", just the font name below.
 # To use the default console font, comment out the CONSOLEFONT setting below.
 # This setting is used by the /etc/init.d/consolefont script (NOTE: if you do
 # not want to use it, run "rc-update del consolefont" as root).

CONSOLEFONT="ter-k14n"

# CONSOLETRANSLATION is the charset map file to use. Leave commented to use # the default one. Have a look in /usr/share/consoletrans for a selection of # map files you can use.

#CONSOLETRANSLATION="8859-1_to_uni"

Установка раскладки клавиатуры

Раскладка клавиатуры определяется в файле /etc/conf.d/keymaps.

Файлы раскладок находятся в каталоге /usr/share/keymaps/i386/qwerty.

Правим /etc/conf.d/keymaps

# Use KEYMAP to specify the default console keymap.  There is a complete tree
# of keymaps in /usr/share/keymaps to choose from.

KEYMAP="-u ru4"

# Should we first load the 'windowkeys' console keymap? Most x86 users will # say "yes" here. Note that non-x86 users should leave it as "no".

SET_WINDOWKEYS="yes"

# The maps to load for extended keyboards. Most users will leave this as is.

EXTENDED_KEYMAPS=""
#EXTENDED_KEYMAPS="backspace keypad euro"

# Tell dumpkeys(1) to interpret character action codes to be # from the specified character set. # This only matters if you set UNICODE="yes" in /etc/rc.conf. # For a list of valid sets, run `dumpkeys --help`

DUMPKEYS_CHARSET="koi8-r"

Установка локали UTF-8

Для установки локали следует создать(изменить) файл /etc/env.d/02locale и добавить(изменить) в него строку

 LANG="ru_RU.UTF-8"

которая определяет все локально-зависимые переменные. Далее выполняем команду

 # env-update

которая дополняет глобальный профильный файл /etc/profile, после чего его следует перечитать

 # source /etc/profile

Выполняем

 # locale

после чего последует вывод на экран

 LANG=ru_RU.UTF-8
 LC_CTYPE="ru_RU.UTF-8"
.....
LC_IDENTIFICATION="ru_RU.UTF-8" LC_ALL=

Теперь изменяем строку в файле /etc/rc.conf к виду

 UNICODE="yes"

Собираем Midnight Commander для UTF-8

 # USE="-ncusers slang unicode" emerge mc

Настраиваем man для UTF-8

 Эта статья не окончена
Личные инструменты