XGRK - Write GREEK in the X Window System

xgrk 1.6.3 , (C) Spiros Ioannou 1998-2001
english  greek


This program is a contribution to the community of greek UNIX users. It provides the possibility to change keyboard mapping with alt-shift or meta-shift combinations or by clicking on the displayed flag image. You will be able to write greek in X programs like netscape, xedit or xterm without the need for a special keyboard or driver. You must have the greek fonts, which are not provided with this package, but you can find some in the link section at the end of this page.


This program may not work with recent XFree86 distributions with KDE/GNOME combinations. These systems usually have their own layout switching utilities which usually rely on libraries (e.g. libxklavier) which take advantage of the recent XKB Xserver extensions.

Keycodes are auto-detected on startup so it should work with all unices and keyboard layouts.
This program has been succesfully tested with:


I tried to make it as simple as possible, so it depends only on Xlib for the main functionality and libXpm for the .xpm flag.

The greek/uk flag images are in xpm format so that you can change them as you please.
The XPM library (libXpm) can be found here: ftp://koala.inria.fr/pub/xpm/ or here http://koala.ilog.fr/ftp/pub/xpm/
The X keyboard extensions (XKB) are not needed.


1. run make
2. copy the "xgrk" and "xgrk2" binaries somewhere in your path like /usr/local/X11/bin

The xgrk2 binary is created with an alternative xgrk.h from E. Lefty Kreouzis
This one seems to work with different aplications, probably unicode-enabled like the new mozilla builds, gterm etc.
For non-unicode apps like xterm, xedit, netscape communicator 4.7x use xgrk.
xgrk and xgrk2 cannot run at the same time.
  • For xgrk2 you may need _XKB_CHARSET=iso8859-7 in your environment.
  • xgrk2 does not support the middle dot

Hint by Athanasios Douitsis: to run in MacOS's X11 server: edit xgrk.h and xgrk2.h and
#define DUMMY1 XK_F30
#define DUMMY2 XK_F31
#define DUMMY1 XK_Shift_L
#define DUMMY2 XK_Shift_L
You can alternatively download the compiled universal binary below.


You don't have to be root to run this software. For the following information, left or right keys are the same. Note that the keys don't have to be pressed at the same time, only the right order matters.

ActionKey sequence
Keyboard mapping switching: Alt + Shift or Meta + Shift
Accent: ';' and then the letter
diaeresis (dialitika): Shift + ';' and then the letter
accented diaeresis: ';' then Shift+';' and then the letter
Middle Dot (Άνω τελεία ·): Shift + 'w'
Note: characters ';' and ':' are mapped to the 'q' key in greek mode. If there is no Alt key, the Meta key is used.
You may also switch language by clicking onto the flag.

Command line options

-h		Display help for command line options

-poll           poll the xserver for keyboard stat every 25000 us (default)
                This is the default, it works very well, it doesn't take cpu 
                and works under xterm's 'Secure Keyboard'

-event          event based keyboard monitoring
                This is event-based operation, but windows mapped after the 
                xgrk starts aren't always captured by xgrk

-noflag         don't display a window. 
-display        display to connect to
-geometry       where to popup (ex.: -geometry +0+100 or -geometry -1-1)
-v              be verbose
-pi <interval>  default poll interval value is 25000 microseconds.
                If set too high, it will miss keystrokes,
                if set too low, it will eat up cpu.
-rd <interval>  default reset delay value is 100000 microseconds.
                If set too high, you'll get many accented greek characters.
                If set too low, characters won't be accented.
-tt             toggle timeout: counted in "poll_interval"s
                how quick alt and shift must be pressed. Default=10
-save           save current keycodes to file ($HOME/.xgrk-hostname)
-restore        restore previously saved keycodes

It is a good idea to put the following in your .xinitrc:
xgrk -save

This will create the file $HOME/.xgrk-hostname with the original keycodes.
If you don't use an .xinitrc file, just run the above command once from an xterm.

Then, add to your window manager a mouse menu which executes the following:
xgrk -restore

This way, if xgrk gets killed and you're stuck in greek mode, you'll be able to restore the original keyboard status with the mouse menu.

Notes for greek support in Netscape 4.x

Trick for netscape to display greek fonts in forms and buttons correctly:
  1. Start netscape with : netscape -xrm "*documentFonts.charset*iso8859-7:iso-8859-1"
  2. Go to Edit->Preferences-Fonts, choose 8859-1 (or western) (netscape thinks that greek fonts are 8859-1 now), and choose a greek font like Lucidasansgreek for the Variable Width Font field. Do the same for the Fixed Width font.
You're set. You can now use pages like http://www.hellasyellow.gr/onom.html and write greek inside the forms.
Note: The UNIX version of Mozilla seems to handle greek almost perfectly :-)

Notes for fvwm2

Add theese to the appropriate fields in your .fvwm2rc:
fvwm2 style: Style "xgrk" RandomPlacement, NoTitle, StaysOnTop, NoHandles, BorderWidth 0

fvwm2 swallow option:
Very cool, it gets swallowed as a button in the bar:
*FvwmButtons( Center Size 60 40 Swallow(UseOld) xgrk `Exec exec xgrk &`)

Unknown BUGS

Well there should be many bugs. Please mail bug corrections and reports to


I've been asked to implement the following stuff. I'll try to implement them when I find the time.
  • Configurable accent key (for Norwegian keyboards which produce ';' with Shift+',').
  • Support for unicode polytonic greek (ancient greek)
  • Better support for Control sequences. (Switch back to greek after Ctrl+c ?)
  • Unify xgrk and xgrk2


You can mail me for help.
Other useful info can be found at: http://www.hri.org/fonts
and many fonts and links here:http://www.ccss.de/slovo/unifonts.htm

Did it work for your OS succesfully?

Please mail me to add your OS in the compatibility list.
For bug-reports/questions (please,only xgrk-related!) :