forked from lyfeyaj/sublime-text-imfix
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsublime-imfix
executable file
·131 lines (113 loc) · 4.02 KB
/
sublime-imfix
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
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
#!/bin/bash
echo "Checking for installation of Sublime Text 3..........."
if which subl
then
echo ".............................................Installed"
else
echo "It seems that you do not install Sublime Text 3 in your system."
echo 'Do you want to install it? [Y/N]'
read sublime_input
if [ $sublime_input == 'Y' ] || [ $sublime_input == 'y' ]
then
echo ''
echo '**************** Adding Sublime Text 3 PPA *****************'
echo ''
sudo add-apt-repository -y ppa:webupd8team/sublime-text-3
echo ''
echo '**************** Updating and upgrading system **************'
echo ''
sudo apt-get update >> /dev/null && sudo apt-get upgrade >> /dev/null
echo ''
echo '**************** Installing Sublime Text 3 *****************'
echo ''
sudo apt-get install -y sublime-text-installer >> /dev/null
echo ''
echo '**************** Sublime Text 3 installed successfully *****'
else
echo ''
echo '**************** Skip installing Sublime Text 3 ************'
fi
fi
echo ''
echo "Checking for installation of Fcitx Input Methods...."
if which fcitx
then
echo "...........................................Installed"
else
echo "It seems that you do not install Fcitx Input Method in your system."
echo 'Do you want to install it? [Y/N]'
read fcitx_input
if [ $fcitx_input == 'Y' ] || [ $fcitx_input == 'y' ]
then
echo ''
echo '**************** Adding Fcitx PPA **************************'
echo ''
sudo add-apt-repository -y ppa:fcitx-team/nightly
echo ''
echo '**************** Updating system ***************************'
echo ''
sudo apt-get update >> /dev/null
echo ''
echo '**************** Installing Fcitx and Pinyin methods *******'
echo ''
sudo apt-get install -y fcitx fcitx-config-gtk fcitx-sunpinyin fcitx-googlepinyin fcitx-module-cloudpinyin fcitx-sogoupinyin > /dev/null
echo ''
echo '**************** Installing Fcitx related libs *************'
echo ''
sudo apt-get install -y build-essential libgtk2.0-dev >> /dev/null
sudo apt-get install -y fcitx-table-all >> /dev/null
echo ''
echo '**************** Fcitx installed successfully! **************'
echo ''
echo '**************** Setting Fcitx as the default input method! *'
im-switch -s fcitx -z default
else
echo ''
echo '**************** Skip installing Sublime Text 3 ************'
fi
fi
if which subl && which fcitx
then
echo ''
echo '**************** Adding shared lib to sublime directory *****'
echo ''
echo '**************** Checking for existing file *****************'
if [ -e '/opt/sublime_text/libsublime-imfix.so' ]
then
echo ''
echo '**************** libsublime-imfix.so is already existing ****'
sudo rm /opt/sublime_text/libsublime-imfix.so
sudo cp ./lib/libsublime-imfix.so /opt/sublime_text/
else
sudo cp ./lib/libsublime-imfix.so /opt/sublime_text/
fi
echo ''
echo '**************** Replacing subl with new one ****************'
echo ''
if [ -e '/usr/bin/subl' ]
then
sudo rm /usr/bin/subl && sudo cp ./src/subl /usr/bin/
fi
echo '**************** Replacing sublime-text.desktop with new one ****************'
if [ -e '/usr/share/applications/sublime-text.desktop' ]
then
sudo rm /usr/share/applications/sublime-text.desktop && sudo cp ./src/sublime-text.desktop /usr/share/applications/
sudo chmod 644 /usr/share/applications/sublime-text.desktop
fi
echo '**************** Sublime Text input method problem fixed! ****'
echo ''
echo '**************** More: Installing extra skins ****************'
echo ''
echo '**************** Un-packing skin into current folders ********'
echo ''
tar -zxvf src/anran.tar.gz
echo '** Copying skin to Fcitx skin folder: /usr/share/fcitx/skin **'
echo ''
sudo cp -r anran /usr/share/fcitx/skin/
rm -r anran
echo 'Done!'
echo ''
echo 'Thanks for using this script to fix SublimeText 3 for Input Method.'
echo ''
echo 'Re-login your X windows and start to use SublimeText 3 with Fctix!'
fi