modified: install_shell/set_fcitx.sh
This commit is contained in:
@@ -1,9 +1,12 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
|
set -x -e
|
||||||
|
|
||||||
IM_CONFIG=/usr/share/config/kdm/Xsession
|
IM_CONFIG=/usr/share/config/kdm/Xsession
|
||||||
|
|
||||||
grep "LC_CTYPE" /etc/csh.cshrc
|
#grep "LC_CTYPE" /etc/csh.cshrc
|
||||||
if [ $? -ne 0 ];then
|
#if [ $? -ne 0 ];then
|
||||||
|
if grep -q -v "LC_CTYPE" /etc/csh.cshrc;then
|
||||||
echo "setenv LC_CTYPE zh_CN.gb18030">>/etc/csh.cshrc
|
echo "setenv LC_CTYPE zh_CN.gb18030">>/etc/csh.cshrc
|
||||||
fi
|
fi
|
||||||
|
|
||||||
@@ -20,8 +23,9 @@ fi
|
|||||||
line1=$(grep -n $1 $IM_CONFIG | tail -n 1 | cut -d: -f1)
|
line1=$(grep -n $1 $IM_CONFIG | tail -n 1 | cut -d: -f1)
|
||||||
line2=$(grep -n ${imethod} $IM_CONFIG | tail -n 1 | cut -d: -f1)
|
line2=$(grep -n ${imethod} $IM_CONFIG | tail -n 1 | cut -d: -f1)
|
||||||
|
|
||||||
grep $1 $IM_CONFIG | tail -n 1 | grep '#' &> /dev/null
|
#grep $1 $IM_CONFIG | tail -n 1 | grep '#' &> /dev/null
|
||||||
if [ $? -eq 0 ];then
|
#if [ $? -eq 0 ];then
|
||||||
|
if grep "$1" "$IM_CONFIG" | tail -n 1 | grep '#';then
|
||||||
sed -i "${line1}s@#@@" $IM_CONFIG
|
sed -i "${line1}s@#@@" $IM_CONFIG
|
||||||
sed -i "${line2}s@^@#&@" $IM_CONFIG
|
sed -i "${line2}s@^@#&@" $IM_CONFIG
|
||||||
echo "$1 change successful."
|
echo "$1 change successful."
|
||||||
|
|||||||
Reference in New Issue
Block a user