Inputmethod in LiveCD

  • The screenshot below is gcin in Puppy Linux version 2.16. Homepage: http://cle.linux.org.tw/gcin/
  • Gcin supports Traditional Chinese, Simplified Chinese, Japanese, and many other languages.

http://cle.linux.org.tw/trac/attachment/wiki/TmpPhoto/puppylinux.png?format=raw

STEP by STEP

  • get a GTK+ 2.x based LiveCD. Puppy Linux is a good choice.
  • Setup your network, and make sure you can connect to internet.
  • example shell script for Puppy Linux
    #!/bin/sh
    
    # install Chinese font
    wget http://nchc.dl.sourceforge.net/sourceforge/wqy/wqy-bitmapfont-pcf-0.8.1-7.tar.gz
    mkdir .fonts
    cd .fonts
    tar zxf ../wqy-bitmapfont-pcf-0.8.1-7.tar.gz wqy-bitmapfont/wenquanyi_12pt.pcf
    fc-cache
    cd ..
    
    # install gcin
    wget http://tw.archive.ubuntu.com/ubuntu/pool/universe/g/gcin/gcin_1.3.3-1~dapper1_i386.deb
    mkdir -p /usr/share/gcin/script
    touch /usr/share/gcin/script/gcin-user-setup
    chmod 755 /usr/share/gcin/script/gcin-user-setup
    mkdir -p .gcin/config
    
    # This is necessary for Puppy Linux v2.16
    echo 0 > .gcin/config/gcin-status-tray
    
    echo zo > .gcin/config/phonetic-keyboard
    cd .gcin
    dpkg-deb -x ../gcin_1.3.3-1~dapper1_i386.deb .
    cd ..
    
    # get last two lines of this script and put them into /etc/gtk-2.0/gtk.immodules
    tail -n 2 $0 >> /etc/gtk-2.0/gtk.immodules
    sed 's~/usr/lib/libpangoxft-1.0.so.0~/usr/lib/libpangoxft-1.0.so.0:/root/.gcin/usr/lib/libgcin-im-client.so.1~' /usr/lib/mozilla/mozilla-bin > mozilla-temp
    mv mozilla-temp /usr/lib/mozilla/mozilla-bin
    chmod 755 /usr/lib/mozilla/mozilla-bin
    export GCIN_TABLE_DIR=/root/.gcin/usr/share/gcin/table
    /root/.gcin/usr/bin/gcin &
    echo
    echo
    echo export LD_PRELOAD=/root/.gcin/usr/lib/libgcin-im-client.so.1
    echo
    exec echo
    
    # Data for /etc/gtk-2.0/gtk.immodules
    "/root/.gcin/usr/lib/gtk-2.0/2.4.0/immodules/im-gcin.so"
    "gcin" "gcin Input Method" "gtk20" "/usr/share/locale" "*"
    
  • export LD_PRELOAD before running your applications
    export LD_PRELOAD=/root/.gcin/usr/lib/libgcin-im-client.so.1
    leafpad &
    

FAQ

Q: Why I can not input Chinese in rxvt?
A: Only GTK+ 2.x based applications are supported.

References