-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathoxim-start.sh.in
executable file
·74 lines (64 loc) · 1.77 KB
/
oxim-start.sh.in
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
#!/bin/sh
#
# Open X Input Method startup script.
#
# By Firefly.
#
OXIM_IM_MODULE_DIR="@OXIM_IM_MODULE_DIR@"
XIM=oxim
export XMODIFIERS="@im=${XIM}"
export XIM_PROGRAM=`which oxim`
export XIM_ARGS="-x oxim"
# 是否使用虛擬鍵盤
#VIRTUAL_KEYBOARD=no
#AUTO_DOCK=no
#if [ -f /etc/sysconfig/oxvkb ] ; then
# . /etc/sysconfig/oxvkb
#fi
#if [ ${VIRTUAL_KEYBOARD} = "yes" ] ; then
# export XIM_ARGS="$XIM_ARGS -k"
#fi
#if [ ${AUTO_DOCK} = "yes" ] ; then
# export XIM_ARGS="$XIM_ARGS -K"
#fi
# DISABLE_IMSETTINGS=yes
PREFERENCE_PROGRAM=/usr/bin/oxim-setup
USR_DIR="$HOME/.oxim"
GTK_IM_MODULE_FILE="${USR_DIR}/gtk.immodules"
# 找出 gtk-query-immodules 指令的完整路徑與真正名稱
for cmd in gtk-query-immodules-2.0-64 \
gtk-query-immodules-2.0-32 \
gtk-query-immodules-2.0 \
gtk-query-immodules
do
TEST_CMD=`which ${cmd} 2>/dev/null`
if [ ! -z ${TEST_CMD} ]
then
GTK_QRY_CMD=${TEST_CMD}
break
fi
done
# 檢查 OXIM 的 GTK2 輸入模組是否安裝
#if [ -f ${OXIM_IM_MODULE_DIR}/gtk-im-oxim.so ] ; then
# 檢查使用者家目錄之下是否有下列目錄
# if [ ! -d ${USR_DIR} ] ; then
# mkdir -p ${USR_DIR}
# fi
# 建一個 gtk im modules 的紀錄檔
# if [ ! -z ${GTK_QRY_CMD} ] ; then
# ${GTK_QRY_CMD} > ${GTK_IM_MODULE_FILE}
# else
# 否則只建立自己的 immodule 紀錄
# echo "\"${OXIM_IM_MODULE_DIR}/gtk-im-oxim.so\"" > ${GTK_IM_MODULE_FILE}
# echo "\"oxim\" \"Open X Input Method\" \"gtk20\" \"/usr/share/locale\" \"*\"" >> ${GTK_IM_MODULE_FILE}
# fi
# export GTK_IM_MODULE=oxim
# export GTK_IM_MODULE_FILE
#else
# export GTK_IM_MODULE=xim
#fi
export GTK_IM_MODULE=oxim
# 檢查 OXIM 的 QT 輸入模組是否安裝
if [ -f ${OXIM_IM_MODULE_DIR}/qt-im-oxim.so ] ; then
export QT_IM_MODULE=oxim
fi