Difference between revisions of "Smart Common Input Method platform"

From ArchWiki
Jump to: navigation, search
(QT_IM_MODULE="scim-bridge" This configuration is working in Gnome, XFCE, LXDE with last updates on 2009.02.15 (scim 1.4.7-1, scim-bridge 0.4.15-1 from AUR))
(Configure SCIM: general ordering)
Line 43: Line 43:
 
= Configure SCIM =
 
= Configure SCIM =
  
Add the following lines to ~/.xinitrc before executing your DE/WM. If you want all the users of your system to use scim, place these lines in your /etc/profile.
+
In order to work correctly, SCIM configuration needs three steps:
 +
 
 +
1. exporting environment variables
 +
 
 +
2. modify locale-related files
 +
 
 +
3. start the application
 +
 
 +
=== Best case example ===
 +
 
 +
If you use a good DE/WM and do need SCIM to work urgently, put these lines into /etc/profile and reboot:
  
 
  export XMODIFIERS=@im=SCIM
 
  export XMODIFIERS=@im=SCIM
Line 50: Line 60:
 
  scim -d
 
  scim -d
  
If ''export QT_IM_MODULE="scim"'' didn't work for you, you can use 'scim-bridge'' from AUR. This configuration is working in Gnome, XFCE, LXDE with last updates on 2009.02.15 (scim 1.4.7-1, scim-bridge 0.4.15-1 from AUR)
+
This is also the base example. The Correct Way of Doing Things is presented below, together with some common variants.
 +
 
 +
== Environment variables ==
 +
 
 +
Following environment variables have to be exported ''before'' executing scim:
  
 
  export XMODIFIERS=@im=SCIM
 
  export XMODIFIERS=@im=SCIM
 
  export GTK_IM_MODULE="scim"
 
  export GTK_IM_MODULE="scim"
 +
export QT_IM_MODULE="scim"
 +
 +
It is usual to put these lines into some script file, e.g. ~/.xinitrc or /etc/profile (for global settings), or also ~/.config/openbox/autostart.sh (if you use Openbox as WM). If you put them into ~/.xinitrc, they have to be put ''before'' executing your DE/WM.
 +
 +
'''If you do not know which solution is the right one for you, just use /etc/profile.'''
 +
 +
Note: the first environment variable conflicts with some (unusual) options like XMODIFIERS=urxvt.
 +
 +
=== Note for GNOME, XFCE, LXDE ===
 +
 +
If ''export QT_IM_MODULE="scim"'' didn't work for you, you can use 'scim-bridge'' from AUR. This configuration is working in Gnome, XFCE, LXDE with last updates on 2009.02.15 (scim 1.4.7-1, scim-bridge 0.4.15-1 from AUR). Like this:
 +
 
  export QT_IM_MODULE="scim-bridge"
 
  export QT_IM_MODULE="scim-bridge"
scim -d
 
  
If you use  "scim -f socket -c socket -d" instead of
+
=== Note for KDE ===
"scim -d ",you cannot use scim in some qt program,
+
like eva.
+
  
 
For '''KDE''' you should either have ''scim-qtimm-cvs'' installed from AUR, or change QT IMM to '''xim'''. Like this:
 
For '''KDE''' you should either have ''scim-qtimm-cvs'' installed from AUR, or change QT IMM to '''xim'''. Like this:
Line 65: Line 88:
 
  export QT_IM_MODULE="xim"
 
  export QT_IM_MODULE="xim"
  
 +
== Locale-related files ==
  
 +
If your keyboard locale is en_US.UTF-8 (or en_US.utf8), just skip this second step.
  
This is what your .xinitrc file should look like. Note that the "exec ''DE/WM''" line comes '''after''' the lines for SCIM
+
If your keyboard locale is ''not'' en_US.UTF-8 (nor en_US.utf8), you have to modify the first line of ~/.scim/global (or /etc/scim/global to have an user-indipendent effect) according to the following example:
  
  #!/bin/sh
+
  /SupportedUnicodeLocales = en_US.UTF-8,de_CH.UTF-8
+
 
#
+
Obviously, you have to put your locale instead of de_CH.UTF-8.
# ~/.xinitrc
+
 
#
+
Note: your locale has to be active (i.e. you have to uncomment it in /etc/locale-gen and then execute locale-gen as root) ''and'' has to be supported by SCIM (most *.UTF-8 locales are).
# Executed by startx (run your window manager from here)
+
 
#
+
If you do not know which locales you have active at the moment, you can check it:
+
 
# exec wmaker
+
  locale -a
  # exec startkde
+
 
# exec icewm
+
(alternatively you can look at /etc/locale.gen).
# exec blackbox
+
 
# exec fluxbox
+
=== Further troubleshooting with locales ===
+
# SCIM
+
export XMODIFIERS=@im=SCIM
+
export GTK_IM_MODULE="scim"
+
export QT_IM_MODULE="scim"
+
scim -d
+
+
exec gnome-session
+
  
 
If after you have install scim and the necessary input tables, and scim still doesn't work (click on the system tray, and nothing pops up), then you need to set the '''LC_CTYPE''' environmental variable in '''/etc/profile''' to the locale you plan to use. Simply create an entry for LC_CTYPE in /etc/profile, if there isn't one.  
 
If after you have install scim and the necessary input tables, and scim still doesn't work (click on the system tray, and nothing pops up), then you need to set the '''LC_CTYPE''' environmental variable in '''/etc/profile''' to the locale you plan to use. Simply create an entry for LC_CTYPE in /etc/profile, if there isn't one.  
Line 99: Line 116:
 
  locale-gen
 
  locale-gen
  
To get scim working for me, I had to additionally add my current locale to /etc/scim/global (~/.scim/global should work too probably). Change the first line to include your locale. In my case it looks like this now:
 
  
/SupportedUnicodeLocales = en_US.UTF-8,de_CH.UTF-8
+
== Executing SCIM ==
  
== Configure SCIM for GNOME with gdm ==
+
To execute SCIM, you ''usually'' can just execute (but see below):
This method seems to work with GNOME when logging in through gdm.
+
  
1. Install ''scim'' and the relative input methods through pacman
+
scim
  
2. Insert the following lines at the end of your /etc/profile
+
It is common to start SCIM as a daemon, so that you can use your computer/terminal while SCIM is working. '''That is, the normal case is to execute''':
  
  export XMODIFIERS=@im=SCIM
+
  scim -d
export GTK_IM_MODULE="scim"
+
export QT_IM_MODULE="scim"
+
  
3. In your GNOME desktop, go to System > Preferences > Session and create a new command with the following line:
+
As above, it is a common practice to put this command into some script file instead of executing it explicitely. As above, usual places are ~/.xinitrc (after environment variables and before DE/WM), /etc/profile (after environment variables) or ~/.config/openbox/autostart.sh (after environment variables and possibly after some sleep command).
  
scim -f x11 -c simple -d
+
=== Note for GNOME ===
  
4. Restart your machine and enjoy!
+
In case you use GNOME as DE, the command above seems not to work as expected. Instead, you have to execute the following:
  
Note: I tried to put the first three lines in my .xinitrc instead of /etc/profile, but it didn't work for me.
+
  scim -f x11 -c simple -d
 +
 
 +
If you want SCIM to start automatically at startup, go to System > Preferences > Session and create a new command with the line above.
  
 
Note: If you use the line  scim -f socket -c socket -d instead, the configuration of your SCIM will be unmodifiable.
 
Note: If you use the line  scim -f socket -c socket -d instead, the configuration of your SCIM will be unmodifiable.
  
== Steps for KDE with kdm ==
+
=== Note for KDE ===
This method seems to work with KDE when logging in through kdm.
+
  
1. Install '''scim''' and input engines.
+
In case you use KDE as a DE, the command above seems not to work as expected. Instead, you have to execute the following:
  
2. Create a new file called .xprofile in your home folder (~/.xprofile) and add the following lines:
+
  scim -f socket -c socket -d
export XMODIFIERS=@im=SCIM
+
export GTK_IM_MODULE=scim
+
export QT_IM_MODULE=scim
+
scim -f socket -c socket -d
+
If you want all the users of your system to use scim, place these lines in your /etc/profile instead.
+
  
Steps after this one are optional.
+
You can also apply following ''optional'' steps:
  
3. Install '''skim''' from the [http://aur.archlinux.org/packages.php?ID=22652 AUR].
+
1. Install '''skim''' from the [http://aur.archlinux.org/packages.php?ID=22652 AUR].
  
4. Start '''SKIM''', right click on the system tray icon and click 'Configure'
+
2. Start '''SKIM''', right click on the system tray icon and click 'Configure'
  
5. Under '''Frontend > X Window''', tick the checkbox for "Start skim automatically when KDE starts"
+
3. Under '''Frontend > X Window''', tick the checkbox for "Start skim automatically when KDE starts"
  
6. Logout and restart X server (ctrl+alt+del), then login again
+
4. Logout and restart X server (ctrl+alt+del), then login again
  
 
In any application, press ''ctrl+space'' to activate the input window.
 
In any application, press ''ctrl+space'' to activate the input window.
 
 
  
 
[http://www.archlinux.org/news/166/ See the official news page for more details].
 
[http://www.archlinux.org/news/166/ See the official news page for more details].
  
 
[http://www.h4.dion.ne.jp/~apricots/scim-anthy/howto.html Complex SCIM Mandriva howto type Japaneese]
 
[http://www.h4.dion.ne.jp/~apricots/scim-anthy/howto.html Complex SCIM Mandriva howto type Japaneese]

Revision as of 16:46, 4 March 2009

Template:I18n links start Template:I18n entry Template:I18n entry Template:I18n entry Template:I18n links end

About SCIM

Su Zhe (or James Su)-who at that time worked for TurboLinux- started this project about 2001 with the goal:

  • Act as an unified frontend for current available input method libraries. Currently bindings to uim and m17n library are available.
  • Act as a language engine of IIIMF input method framework (TBD).
  • Provide as many native IMEngines as possible.
  • Support as many input method protocol/interface as possible.
  • Support as many operating systems as possible.

SCIM has the following features:

  • Fully Object Oriented structure written in C++.
  • Highly modularized.
  • Very flexible architecture, can be used as a dynamically loaded library as well as a C/S input method environment.
  • Simple programming interface.
  • Fully i18n support with UCS-4/UTF-8 encoding.
  • Include many handy utility functions to speedup the development.
  • GUI Panel with very rich features.
  • Unified configuration framework.

Installing SCIM

  1. pacman -S scim

Installing Input Method Engines

Currently the SCIM project has a wide range of input methods (some may need other libraries), covering more than 30 languages, including (Simplified/Traditional) Chinese, Japanese, Korean and many European languages. These are some of the examples (more can be found here):

Chinese Smart PinYin:

# pacman -S scim-pinyin

Chinese WuBi or other tables based:

# pacman -S scim-tables

Japanese:

# pacman -S scim-anthy

Korean:

# pacman -S scim-hangul

Configure SCIM

In order to work correctly, SCIM configuration needs three steps:

1. exporting environment variables

2. modify locale-related files

3. start the application

Best case example

If you use a good DE/WM and do need SCIM to work urgently, put these lines into /etc/profile and reboot:

export XMODIFIERS=@im=SCIM
export GTK_IM_MODULE="scim"
export QT_IM_MODULE="scim"
scim -d

This is also the base example. The Correct Way of Doing Things is presented below, together with some common variants.

Environment variables

Following environment variables have to be exported before executing scim:

export XMODIFIERS=@im=SCIM
export GTK_IM_MODULE="scim"
export QT_IM_MODULE="scim"

It is usual to put these lines into some script file, e.g. ~/.xinitrc or /etc/profile (for global settings), or also ~/.config/openbox/autostart.sh (if you use Openbox as WM). If you put them into ~/.xinitrc, they have to be put before executing your DE/WM.

If you do not know which solution is the right one for you, just use /etc/profile.

Note: the first environment variable conflicts with some (unusual) options like XMODIFIERS=urxvt.

Note for GNOME, XFCE, LXDE

If export QT_IM_MODULE="scim" didn't work for you, you can use 'scim-bridge from AUR. This configuration is working in Gnome, XFCE, LXDE with last updates on 2009.02.15 (scim 1.4.7-1, scim-bridge 0.4.15-1 from AUR). Like this:

export QT_IM_MODULE="scim-bridge"

Note for KDE

For KDE you should either have scim-qtimm-cvs installed from AUR, or change QT IMM to xim. Like this:

export QT_IM_MODULE="xim"

Locale-related files

If your keyboard locale is en_US.UTF-8 (or en_US.utf8), just skip this second step.

If your keyboard locale is not en_US.UTF-8 (nor en_US.utf8), you have to modify the first line of ~/.scim/global (or /etc/scim/global to have an user-indipendent effect) according to the following example:

/SupportedUnicodeLocales = en_US.UTF-8,de_CH.UTF-8

Obviously, you have to put your locale instead of de_CH.UTF-8.

Note: your locale has to be active (i.e. you have to uncomment it in /etc/locale-gen and then execute locale-gen as root) and has to be supported by SCIM (most *.UTF-8 locales are).

If you do not know which locales you have active at the moment, you can check it:

locale -a

(alternatively you can look at /etc/locale.gen).

Further troubleshooting with locales

If after you have install scim and the necessary input tables, and scim still doesn't work (click on the system tray, and nothing pops up), then you need to set the LC_CTYPE environmental variable in /etc/profile to the locale you plan to use. Simply create an entry for LC_CTYPE in /etc/profile, if there isn't one.

eg.   LC_CTYPE="zh_CN.utf8"              //if you want to type simplified chinese

Finally you need to generate the locale using the locale-gen command. Modify the /etc/locale.gen file to uncomment the language and encoding set you wish to use scim with. Then run the following command to generate the locale for your system.

locale-gen


Executing SCIM

To execute SCIM, you usually can just execute (but see below):

scim

It is common to start SCIM as a daemon, so that you can use your computer/terminal while SCIM is working. That is, the normal case is to execute:

scim -d

As above, it is a common practice to put this command into some script file instead of executing it explicitely. As above, usual places are ~/.xinitrc (after environment variables and before DE/WM), /etc/profile (after environment variables) or ~/.config/openbox/autostart.sh (after environment variables and possibly after some sleep command).

Note for GNOME

In case you use GNOME as DE, the command above seems not to work as expected. Instead, you have to execute the following:

 scim -f x11 -c simple -d

If you want SCIM to start automatically at startup, go to System > Preferences > Session and create a new command with the line above.

Note: If you use the line scim -f socket -c socket -d instead, the configuration of your SCIM will be unmodifiable.

Note for KDE

In case you use KDE as a DE, the command above seems not to work as expected. Instead, you have to execute the following:

 scim -f socket -c socket -d

You can also apply following optional steps:

1. Install skim from the AUR.

2. Start SKIM, right click on the system tray icon and click 'Configure'

3. Under Frontend > X Window, tick the checkbox for "Start skim automatically when KDE starts"

4. Logout and restart X server (ctrl+alt+del), then login again

In any application, press ctrl+space to activate the input window.

See the official news page for more details.

Complex SCIM Mandriva howto type Japaneese