man im-config里面有个IM_CONFIG_PHASE,这变量含义是?

最大的社区版本,Ubuntu的发源地
回复
poloshiao
论坛版主
帖子: 18279
注册时间: 2009-08-04 16:33

Re: man im-config里面有个IM_CONFIG_PHASE,这变量含义是?

#2

帖子 poloshiao » 2016-03-09 7:23

1. /usr/share/doc/im-config/README.Debian.gz
sudo gzip -d /usr/share/doc/im-config/README.Debian.gz
sudo cat /usr/share/doc/im-config/README.Debian | grep IM_CONFIG_PHASE
* Environment variables are set if "$IM_CONFIG_PHASE" = 1
* Daemon programs are started if "$IM_CONFIG_PHASE" = 2

2. http://manpages.ubuntu.com/manpages/xen ... fig.8.html
im-config - set up input method configuration for X Window System
If you wish to create a custom configuration beyond what im-config can
do for you, please copy one of these initialization code files into
~/.xinputrc or /etc/X11/xinit/xinputrc and edit it to suite your need.
For example, 02_cjkv.rc tells how input method can be customized for
each locale. This script should be written to set environment
variables if "$IM_CONFIG_PHASE" = 1 and to start daemon programs if
"$IM_CONFIG_PHASE" = 2 .

3. 意即
if "$IM_CONFIG_PHASE" = 1 修改該 script 設定環境變數
if "$IM_CONFIG_PHASE" = 2 修改該 script 啟動 daemon 程式
科学之子
帖子: 2284
注册时间: 2013-05-26 6:58
系统: Debian 9

Re: man im-config里面有个IM_CONFIG_PHASE,这变量含义是?

#3

帖子 科学之子 » 2016-03-12 13:15

poloshiao 写了:1. /usr/share/doc/im-config/README.Debian.gz
sudo gzip -d /usr/share/doc/im-config/README.Debian.gz
sudo cat /usr/share/doc/im-config/README.Debian | grep IM_CONFIG_PHASE
* Environment variables are set if "$IM_CONFIG_PHASE" = 1
* Daemon programs are started if "$IM_CONFIG_PHASE" = 2

2. http://manpages.ubuntu.com/manpages/xen ... fig.8.html
im-config - set up input method configuration for X Window System
If you wish to create a custom configuration beyond what im-config can
do for you, please copy one of these initialization code files into
~/.xinputrc or /etc/X11/xinit/xinputrc and edit it to suite your need.
For example, 02_cjkv.rc tells how input method can be customized for
each locale. This script should be written to set environment
variables if "$IM_CONFIG_PHASE" = 1 and to start daemon programs if
"$IM_CONFIG_PHASE" = 2 .

3. 意即
if "$IM_CONFIG_PHASE" = 1 修改該 script 設定環境變數
if "$IM_CONFIG_PHASE" = 2 修改該 script 啟動 daemon 程式
"意思"虽然明白了,但该变量的值是来自哪里?
Sat Mar 12 13:30:48 CST 2016:

代码: 全选

/usr$ grep -r IM_CONFIG_PHASE 
得到:/usr/bin/im-launch
得知2的来源(不知是否正确)

代码: 全选

/etc$ grep -r IM_CONFIG_PHASE=1 
/etc/X11/Xsession.d/70im-config_launch
得知1的来源(不知是否正确)
poloshiao
论坛版主
帖子: 18279
注册时间: 2009-08-04 16:33

Re: man im-config里面有个IM_CONFIG_PHASE,这变量含义是?

#4

帖子 poloshiao » 2016-03-12 19:33

"意思"虽然明白了,但该变量的是来自哪里?
sudo cat /etc/X11/Xsession.d/70im-config_launch | grep IM_CONFIG_PHASE
IM_CONFIG_PHASE=1
export IM_CONFIG_PHASE

參見
http://manpages.ubuntu.com/manpages/xen ... fig.8.html
The im-config package installs a hook script /etc/X11/Xsession.d/70im-config_launch. When X starts, it sources this file as a POSIX shell code. Then this hook script tries to source the user configuration file ~/.xinputrc, if it exists. Otherwise, this hook script sources the system configuration file /etc/X11/xinit/xinputrc.
回复