-
Notifications
You must be signed in to change notification settings - Fork 21
/
install.sh
executable file
·73 lines (52 loc) · 1.31 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
#!/bin/bash
Parameter=$1
CHECK_COMMAND_TWEAK(){
if [ ! `command -v gnome-shell-extension-tool` ]; then
return 1
fi
if [ ! `command -v sudo` ]; then
return 1
fi
}
CHECK_COMMAND_SUDO(){
if [ ! `command -v sudo` ]; then
return 1
fi
}
ENABLE(){
gnome-shell-extension-tool -e [email protected]
}
MAKEPROJECT() {
make -j2
}
INSTALL() {
case $Parameter in
root)
printf "\033[32m Current mode: SuperUser.\033[0m\n"
sudo cp -r [email protected] \
/usr/share/gnome-shell/extensions/[email protected]
;;
*)
printf "\033[32m Current mode: NormalUser.\033[0m\n"
cp -r [email protected] \
$HOME/.local/share/gnome-shell/extensions/[email protected]
;;
esac
}
printf "\033[32m check the necessary tools ... \033[0m\n"
CHECK_COMMAND_TWEAK
if [ "$?" != "0" ]; then
printf "\033[31m gnome-tweak-tool not found!\033[0m\n"
exit 1
fi
CHECK_COMMAND_SUDO
if [ "$?" != "0" ]; then
printf "\033[31m sudo not found!\033[0m\n"
exit 1
fi
printf "\033[32m make translation documents ... \033[0m\n"
MAKEPROJECT
printf "\033[32m Install the extension ... \033[0m\n"
INSTALL
printf "\033[32m Enabling extension ... \033[0m\n"
ENABLE