Greek Support in the Debian Console

Posted by sonic2000gr on Mon 25 Sep 2006 at 06:20

This article is primarily focussed on the Greek users of Debian out there, and I hope there are quite a few of us! I am using Debian as a server myself and it is quite important to be able to at least show the full greek character set in the console, as some of my files may have greek filenames. Typing Greek in the console is of less importance, although this article covers it as well.

Greek support is very easy to install in the GNOME and KDE desktop environments, although a graphical environment is usually not installed on servers. Thus this article deals with the command line only.

Installing locales

First make sure you have the locales package installed. As root issue the command:

apt-get install locales

This will install the package - if it was not already installed. Again as root, execute:
dpkg-reconfigure locales

This command will allow you to select locale. In the dialog that follows you can select as many locales as you wish. In our case you need to at least select:
  • el_GR.UTF-8
  • en_US.UTF-8
You will also be asked to choose a default locale. You may opt to select the en_US locale as default. If you select the el_GR as the default, system messages like error messages and warnings will be displayed in Greek. This is rather annoying for adminstration purposes (at least for me).



Changes to other files

As root edit the file

/etc/inputrc
and make sure the following lines appear (edit or add as necessary):

set meta-flag on
set output-meta on
set convert-meta off
Also edit the file
/etc/console-tools/config
and edit or add the following lines (you will need to uncomment some of them):
SCREEN_FONT=iso07.f16

At the end of the file, you will see some lines with APP_CHARSET_MAP. Change them to look like the ones below:
APP_CHARSET_MAP=iso07
APP_CHARSET_MAP_vc1=iso07
APP_CHARSET_MAP_vc2=iso07
APP_CHARSET_MAP_vc3=iso07
APP_CHARSET_MAP_vc4=iso07
APP_CHARSET_MAP_vc5=iso07
APP_CHARSET_MAP_vc6=iso07
(Note: vc1 to vc6 are for virtual consoles)

Loading the greek keyboard mapping

Can be easily performed by the following command:
loadkeys /usr/share/keymaps/i386/qwerty/gr-utf8.kmap.gz
However, since you will obviously need to load this at every startup, it would be nice to add it to a startup script somewhere. I have added a line to the
/etc/init.d/console-screen.sh
script that deals with this matter anyways:
.
.
.
 loadkeys /usr/share/keymaps/i386/qwerty/gr-utf8.kmap.gz
}
case "$1" in
  start|reload|restart|force-reload)
.
.
.

Possibly modify the users' .bashrc

Include the following lines at your .bashrc file:
export LC_CTYPE="el_GR.UTF-8"
export LC_MESSAGES="en_US.UTF-8"

If you would like the system messages to be in greek, the second line should read:
export LC_MESSAGES="el_GR.UTF-8"

Greek / Latin mappings can be toggled by pressing the ALT+SHIFT keys (like windows). If you use Putty to connect through, then use CTRL+SHIFT.

Bugs / Limitations

You can view accented characters but not type them! This is not very important, unless you would really like to do greek file editing in the console. Accented characters can by typed normally through Putty which is even more puzzling...

 

 


Posted by mikekgr (146.124.xx.xx) on Mon 25 Sep 2006 at 07:19
[ Send Message ]
Dear sonic2000gr,
as Greek guy too, I like your article here. Thanks in the name of all Greek Debian users.
Only I have a question, why it is necessary to edit the /etc/init.d/console-screen.sh file ??? There is not any other way to load gr-utf8.kmap.gz ??? I feel something wrong here.

Thanks a lot.

Best Regards,
Mike Kranidis

[ Parent | Reply to this comment ]

Posted by sonic2000gr (83.235.xx.xx) on Mon 25 Sep 2006 at 15:43
[ Send Message ]
Hi Mike and thanks for the comment.

You are quite right, adding the command in the console-screen.sh is kind of a hack. Actually I first tried to do it in this way:
There is a file in /etc/console called boottime.kmap.gz
I naturally supposed this is the keymap loaded at boot. So I copied the gr-utf8.kmap.gz in there and renamed it to boottime.kmap.gz
Weird, but that had no effect. I could not get it to work even after lot of fiddling and searching the related scripts. Then I decided to go with this hack. It is not the best, but it works.

[ Parent | Reply to this comment ]

Posted by kl (83.17.xx.xx) on Mon 25 Sep 2006 at 09:20
[ Send Message ]
However, since you will obviously need to load this at every startup, it would be nice to add it to a startup script somewhere. I have added a line to the
/etc/init.d/console-screen.sh
I think that simply doing "install-keymap MAPNAME" once is preferred way.

[ Parent | Reply to this comment ]

Posted by sonic2000gr (83.235.xx.xx) on Mon 25 Sep 2006 at 15:48
[ Send Message ]
Hi and thanks for your comment!
I must admit I didn't know about the install-keymap command! I tested myself copying the gr-utf8.kmap.gz to /etc/console and renaming it to boottime.kmap.gz and that did not work.
As I am reading the man page of install-keymap I see it does more things than simply copying the file there. I will give it a try on a vmware setup and see what happens. Maybe the hack will not be needed after all.

Thanks again for your help.

[ Parent | Reply to this comment ]

Posted by sonic2000gr (87.203.xx.xx) on Mon 2 Oct 2006 at 13:44
[ Send Message ]
I just tried this one and it really works fine. Thanks! So in fact, without changing the console-screen.sh script, you just execute:

install-keymap /usr/share/keymaps/i386/qwerty/gr-utf8.kmap.gz

The rest of the article stands as is.

[ Parent | Reply to this comment ]

Posted by Anonymous (212.24.xx.xx) on Mon 25 Sep 2006 at 10:21
gr-utf8 puts the "Compose" key on "altgr control keycode 52"

That is "altgr" then "Compose"+"." then compose sequence.

Not exactly easiest compose key combination, you might want to remap it. If it works file a bug to get it moved somewhere more sensible.

Found using; (dumpkeys | less) and search for "Compose")

You ought to be able to type Greek characters by using the normal compose key combinations (dumpkeys --compose-only), although I find I'm still struggling to get them displayed correctly, YMMV I haven't followed the rest of the article as I'm not Greek.

[ Parent | Reply to this comment ]

Sign In

Username:

Password:

[Register|Advanced]

 

Flattr

 

Current Poll

Which init system are you using in Debian?






( 1032 votes ~ 6 comments )