Friday, 23 January 2009

Cygwin/X awkward upgrade (changes with move X.Org X11R7.4)

Watch out if you use X on Cygwin and if you've not updated (since Nov 2008?) After a Cygwin upgrade my Cygwin/X was b0rked :(
After Google + read FAQ + reconfig mess and add new Cygwin fonts and x tools packages all is fixed again :)

Upgrade wasn't clean, after it X didn't start with errors:

Warning: Unable to load any usable ISO8859 font
Error: Aborting: no font found

and/or:

Could not init font path element /usr/share/fonts/OTF

and/or if it does start:

keyboard doesn't work!

and:

fonts in emacs don't display - chars are all squares

xterm not found, won't start with font error ("ISO8859 font")

funny menu in xterm



Solving it was a matter of adding needed packages such as fonts and x tools which now do not come by default. Also need to fix any customisations you use in cygwin/X as paths etc have changed.

Good detail in the FAQ:
http://x.cygwin.com/docs/faq/cygwin-x-faq.html#q-x-is-broke

"The upgrade from X.Org R6.8 to modular X.Org R7.4 makes a lot of changes. Please read the announce email and pay attention to the upgrade instructions."

http://cygwin.com/ml/cygwin-xfree-announce/2008-11/msg00000.html

From: "Yaakov (Cygwin Ports)"
Date: Tue, 11 Nov 2008 10:42:45 -0600
"Cygwin/X has been updated to X.Org X11R7.4."




From of old I have started Cygwin/X session like this:
C:\cygwin\bin\rxvt.exe -e /cygdrive/c/cygwin/bin/bash.exe --login -e startx

With customisations in ~/.{xinitrc,xserverrc,XModmap} to get keyboard right and start fvwm2.


$ cat .xserverrc
exec XWin :0 -clipboard



$ cat .xinitrc
#!/bin/sh
# $Xorg: xinitrc.cpp,v 1.3 2000/08/17 19:54:30 cpqbld Exp $

userresources="$HOME"/.Xresources
usermodmap="$HOME"/.Xmodmap
sysresources=/usr/X11R6/lib/X11/xinit/.Xresources
sysmodmap=/usr/X11R6/lib/X11/xinit/.Xmodmap

# merge in defaults and keymaps

if [ -f "$sysresources" ]; then
xrdb -merge "$sysresources"
fi

if [ -f "$sysmodmap" ]; then
xmodmap "$sysmodmap"
fi

if [ -f "$userresources" ]; then
xrdb -merge "$userresources"
fi

if [ -f "$usermodmap" ]; then
xmodmap "$usermodmap"
fi

# start some nice programs

fvwm2 &

xterm -e /usr/bin/bash -l
# exec xterm
# if you exec?start something then when you exit it all of X shuts down



.Xmodmap # varies depending on machine+keyboard

! for laptop
! for usb/wireless microsoft kbd

!!! \\||~~##``??//@@''""22££$$ !"£$%^&*() -_=+ {[}] :;@' <,>.?/

! R QWERTY row
!keycode 51 = backslash bar
! but this is tilde and hash on usb (R-1 ASD row)
keycode 51 = numbersign asciitilde

! Left - 1 zxc row (beside shift), already default
! keycode 91 = backslash bar


!! the notsign is useless to me & doesn't work
!! so change to something useful
! laptop and usb
! top L 123 row
!keycode 49 (keysym 0xac, notsign) (ac) "¬"
!keycode 49 (keysym 0x60, grave) (60) "`"
! german: keycode 49 = asciicircum degree
keycode 49 = grave bar
!keycode 49 = grave backslash
!keycode 49 = grave asciitilde

!! also CAPS-LOCK is useless >;)
!keycode 66 = Caps_Lock
!keycode 66 = numbersign asciitilde
keycode 66 =

!! keycode 12 = 3£ OR 3# . is confused? (changes with caps-lock?)
!! running xev produces £ okay ... but ... produces #+CR in term?
! keycode 12 = 3£ OR 3# . is confused?


!! for laptop:
keycode 66 = EuroSign EuroSign
!$ xmodmap -pke | grep EuroSign
!keycode 13 = 4 dollar EuroSign cent EuroSign cent
!keycode 66 = EuroSign EuroSign
!$ xmodmap -pke | grep " e "
!keycode 26 = e E eacute Eacute eacute Eacute
!bind AltGr+E to the EuroSign symbol
keycode 26 = e E EuroSign EuroSign eacute Eacute

1 comment:

Anonymous said...

Thanks very much for posting this. It helped me resolve the same issue. I just needed to install the font-* packages it turned out.