Previous Next Contents

4. X Windows setup - XFree86 3.1

4.1 Hebrew fonts.

XFree86 3.1 comes with two Hebrew fonts: heb6x13, heb8x13. Additional Hebrew fonts can be found on the Net:

4.2 Installing fonts

4.3 Making an X application to use Hebrew fonts.

In short you need to set the appropriate resource.

Xterm

Put the following line in the $HOME/.Xresources:

xterm*font: heb8x13

or simply start xterm with xterm -fn heb8x13 The above font is way too small, so search for a better one ... See the comments/examples on starting X11.

Netscape

Usaly you can use the hebrew fonts from snunit - webfonts, Install it as described, and then put the next defaults in your local .Xdefaults or in the app-defaults/Netscape.

----
*documentFonts.latin1.variable.italic*slant:            r
*documentFonts.latin1.variable.boldItalic*slant:        r
*documentFonts.latin1.variable*family:                  web
*documentFonts.latin1.fixed*family:                     webmono
*documentFonts.latin1*registry:                         iso8859
*documentFonts.latin1*encoding:                         8
----
In general you can put any fonts insted of the webfonts files as long as its supported by X11 as described.

4.4 Mapping the keyboard.

For some reason the X server doesn't inherit the keymap from the previous paragraph, and anyway I would like to define ALT Left and ALT Right and Scroll Lock. When pressing ALT together with some key it will generate a Hebrew character, Scroll Lock will lock in Hebrew mode.

To do that we need to use xmodmap. Following is a Xmodmap which also corrects the bugs with the "Num Lock":

-----
! Hebrew key mapping for XFree86 (for US/Hebrew keyboards).
! By Vlad Moseanu
!
keysym Alt_L = Mode_switch
keysym Alt_R = Mode_switch
!clear Mod1
clear Mod2
!add Mod1 = Alt_L
add Mod2 = Mode_switch
!
! Set the mapping for each key
!
keycode   8 =
keycode   9 = Escape
keycode  10 = 1 exclam
keycode  11 = 2 at
keycode  12 = 3 numbersign
keycode  13 = 4 dollar
keycode  14 = 5 percent
keycode  15 = 6 asciicircum
keycode  16 = 7 ampersand
keycode  17 = 8 asterisk
keycode  18 = 9 parenleft
keycode  19 = 0 parenright
keycode  20 = minus underscore
keycode  21 = equal plus
keycode  22 = Delete
keycode  23 = Tab
keycode  24 = q Q slash Q
keycode  25 = w W apostrophe W
keycode  26 = e E 0x00f7 E 
keycode  27 = r R 0x00f8 R 
keycode  28 = t T 0x00e0 T 
keycode  29 = y Y 0x00e8 Y 
keycode  30 = u U 0x00e5 U 
keycode  31 = i I 0x00ef I 
keycode  32 = o O 0x00ed O 
keycode  33 = p P 0x00f4 P 
keycode  34 = bracketleft braceleft
keycode  35 = bracketright braceright
keycode  36 = Return
keycode  37 = Control_L
keycode  38 = a A 0x00f9 A 
keycode  39 = s S 0x00e3 S 
keycode  40 = d D 0x00e2 D 
keycode  41 = f F 0x00eb F 
keycode  42 = g G 0x00f2 G 
keycode  43 = h H 0x00e9 H 
keycode  44 = j J 0x00e7 J 
keycode  45 = k K 0x00ec K 
keycode  46 = l L 0x00ea L 
keycode  47 = semicolon colon 0x00f3 colon 
keycode  48 = apostrophe quotedbl comma quotedbl
keycode  49 = grave asciitilde semicolon asciitilde
keycode  50 = Shift_L
keycode  51 = backslash bar
keycode  52 = z Z 0x00e6 Z 
keycode  53 = x X 0x00f1 X 
keycode  54 = c C 0x00e1 C 
keycode  55 = v V 0x00e4 V 
keycode  56 = b B 0x00f0 B 
keycode  57 = n N 0x00ee N 
keycode  58 = m M 0x00f6 M 
keycode  59 = comma less 0x00fa less 
keycode  60 = period greater 0x00f5 greater 
keycode  61 = slash question period question
keycode  62 = Shift_R
keycode  63 = KP_Multiply
!keycode  64 = Alt_L Meta_L
keycode  65 = space
keycode  66 = Caps_Lock
keycode  67 = F1
keycode  68 = F2
keycode  69 = F3
keycode  70 = F4
keycode  71 = F5
keycode  72 = F6
keycode  73 = F7
keycode  74 = F8
keycode  75 = Escape
keycode  76 = F10
keycode  77 = Num_Lock
keycode  78 = Scroll_Lock
keycode  79 = KP_7
keycode  80 = KP_8
keycode  81 = KP_9
keycode  82 = KP_Subtract
keycode  83 = KP_4
keycode  84 = KP_5
keycode  85 = KP_6
keycode  86 = KP_Add
keycode  87 = KP_1
keycode  88 = KP_2
keycode  89 = KP_3
keycode  90 = KP_0
keycode  91 = KP_Decimal
keycode  92 = Sys_Req
keycode  93 =
keycode  94 =
keycode  95 = F11
keycode  96 = F12
keycode  97 = Home
keycode  98 = Up
keycode  99 = Prior
keycode 100 = Left
keycode 101 = Begin
keycode 102 = Right
keycode 103 = End
keycode 104 = Down
keycode 105 = Next
keycode 106 = Insert
keycode 107 = Delete
keycode 108 = KP_Enter
keycode 109 = Control_R
keycode 110 = Pause
keycode 111 = Print
keycode 112 = KP_Divide
!keycode 113 = Alt_R Meta_R
keycode 114 = Break
!
! This xmodmap file can be use to set the correct numerical keypad mapping
! when "ServerNumLock" is set in the XF86Config file.  In this case the
! Xserver takes care of the Num Lock processing.
!
!
keycode  136 = KP_7
keycode  137 = KP_8
keycode  138 = KP_9
keycode  139 = KP_4
keycode  140 = KP_5
keycode  141 = KP_6
keycode  142 = KP_1
keycode  143 = KP_2
keycode  144 = KP_3
keycode  145 = KP_0
keycode  146 = KP_Decimal
keycode  147 = Home
keycode  148 = Up
keycode  149 = Prior
keycode  150 = Left
keycode  151 = Begin
keycode  152 = Right
keycode  153 = End
keycode  154 = Down
keycode  155 = Next
keycode  156 = Insert
keycode  157 = Delete
-----

To use the Xmodmap above define "Scroll-Lock Mode-Lock" in the XF86Config.

4.5 Integrating all the above, examples.

If you are using xdm a $HOME/.xsession should look like the following:

-----
#!/bin/sh
# $XConsortium: Xsession,v 1.9 92/08/29 16:24:57 gildea Exp $
# 
# General defs
#
export OPENWINHOME=/usr/openwin
export MANPATH=/usr/local/man:/usr/man/preformat:/usr/man:/usr/X11R6/man
#export HOSTNAME="`cat /etc/HOSTNAME`"
export PATH="/bin: /usr/bin: /usr/X11/bin: /usr/X386/bin: /usr/TeX/bini: /usr/local/bin: /usr/games:."
LESS=-MM
if [ -z $XAPPLRESDIR ]; then
        XAPPLRESDIR=/usr/lib/X11/app-defaults:/usr/local/lib/X11/app-defaults
else
        XAPPLRESDIR=$XAPPLRESDIR:/usr/lib/X11/app-defaults
fi
export XAPPLRESDIR
#
sysresources=/usr/lib/X11/Xresources
sysmodmap=/usr/lib/X11/Xmodmap
resources=$HOME/.Xresources
xmodmap=$HOME/.Xmodmap
if [ -f $sysresources ]; then
        xrdb -merge $sysresources
fi
if [ -f $sysmodmap ]; then
        xmodmap $sysmodmap
fi
if [ -f $resources ]; then
        xrdb -merge $resources
fi
if [ -f $xmodmap ]; then
        xmodmap $xmodmap
fi
#
# Start applications
#
# xterm -ls -sb &
xhost +                 # look out !!!
exec fvwm
-----

If you prefer startx use the above as an example for .xinitrc.


Previous Next Contents