-
Notifications
You must be signed in to change notification settings - Fork 10
/
install.sh
executable file
·90 lines (67 loc) · 1.22 KB
/
install.sh
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
#!/usr/bin/env bash
main_install_fcitx_chewing () {
echo
echo "sudo apt-get install fcitx-chewing"
sudo apt-get install fcitx-chewing
}
main_im_config_fcitx () {
echo
echo "im-config -n fcitx"
im-config -n fcitx
}
main_cat_xinputrc () {
echo
echo "cat ~/.xinputrc"
cat ~/.xinputrc
}
main_prepare_fcitx_config_dir () {
echo
echo "mkdir -p $HOME/.config/fcitx"
mkdir -p "$HOME/.config/fcitx"
}
main_set_profile () {
echo
echo "cp ./config/set/profile $HOME/.config/fcitx/profile"
cp "./config/set/profile" "$HOME/.config/fcitx/profile"
}
main_config_profile () {
if is_fcitx_running; then
echo
echo 'fcitx is running'
main_stop_fcitx
main_set_profile
main_start_fcitx
else
echo
echo 'fcitx not running'
main_set_profile
main_start_fcitx
fi
}
main_stop_fcitx () {
echo
echo "Stop fcitx"
#qdbus org.fcitx.Fcitx /inputmethod org.fcitx.Fcitx.InputMethod.Exit
killall -9 fcitx
}
main_start_fcitx () {
echo
echo "Start fcitx"
fcitx -r
}
is_fcitx_running () {
fcitx-remote &> /dev/null
if [ "$?" = "0" ]; then
return 0;
else
return 1;
fi
}
__main__ () {
main_install_fcitx_chewing
main_im_config_fcitx
main_cat_xinputrc
main_prepare_fcitx_config_dir
main_config_profile
}
__main__