/
install.sh
executable file
·157 lines (117 loc) · 5.35 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
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
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
#!/bin/bash
# This file is part of TexFlasher.
# Copyright (c) 2012:
# Can Oezmen
# Axel Pfeiffer
#
# TexFlasher is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# TexFlasher is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with TexFlasher If not, see <http://www.gnu.org/licenses/>.
clear
python .TexFlasher/credits.py
echo
if [ -f run-TexFlasher.sh ]; then
rm run-TexFlasher.sh
fi
if [ -f settings ]; then
rm settings
fi
echo "Installation ..."
echo
echo "#!/bin/bash" >> run-TexFlasher.sh
echo "#This file was created automatically by the script 'install.sh'. Changes will be overwritten." >> run-TexFlasher.sh
echo >> run-TexFlasher.sh
echo "#This file is part of TexFlasher." >> run-TexFlasher.sh
echo "#" >> run-TexFlasher.sh
echo "#TexFlasher is free software: you can redistribute it and/or modify">> run-TexFlasher.sh
echo "#it under the terms of the GNU General Public License as published by">> run-TexFlasher.sh
echo "#the Free Software Foundation, either version 3 of the License, or">> run-TexFlasher.sh
echo "#(at your option) any later version.">> run-TexFlasher.sh
echo "#">> run-TexFlasher.sh
echo "#TexFlasher is distributed in the hope that it will be useful," >> run-TexFlasher.sh
echo "#but WITHOUT ANY WARRANTY; without even the implied warranty of" >> run-TexFlasher.sh
echo "#MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the" >> run-TexFlasher.sh
echo "#GNU General Public License for more details." >> run-TexFlasher.sh
echo "#">> run-TexFlasher.sh
echo "#You should have received a copy of the GNU General Public License">> run-TexFlasher.sh
echo "#along with TexFlasher If not, see <http://www.gnu.org/licenses/>.">> run-TexFlasher.sh
# echo -n "Would you like to be notified if updates are available? (Y/n): "
# read ANSWER
# echo "rm UPDATE 2> /dev/null" >> run-TexFlasher.sh
# if [ "$ANSWER" != "n" ]; then
# echo "You will be notified."
# echo "bash .TexFlasher/checkForSourceUpdate.sh &" >> run-TexFlasher.sh
# fi
USERNAME=$1
if [ "$USERNAME" == "" ]; then
USERNAME=$USER
fi
echo "Username: $USERNAME"
echo -n "Press <Return> to accept or enter new username: "
read ANSWER
if [ "$ANSWER" != "" ]; then
USERNAME=$ANSWER
fi
echo "Username: $USERNAME"
echo "clear" >> run-TexFlasher.sh
echo "TEXFLASHDIR=$PWD" >> run-TexFlasher.sh
echo "cd \$TEXFLASHDIR" >> run-TexFlasher.sh
echo "python .TexFlasher/credits.py" >> run-TexFlasher.sh
echo
echo "echo" >> run-TexFlasher.sh
echo "echo \"TexFlasher is free software: you can redistribute it and/or modify\"">> run-TexFlasher.sh
echo "echo \"it under the terms of the GNU General Public License as published by\"">> run-TexFlasher.sh
echo "echo \"the Free Software Foundation, either version 3 of the License, or\"">> run-TexFlasher.sh
echo "echo \"(at your option) any later version.\"">> run-TexFlasher.sh
echo "echo \"\"">> run-TexFlasher.sh
echo "echo \"TexFlasher is distributed in the hope that it will be useful,\"" >> run-TexFlasher.sh
echo "echo \"but WITHOUT ANY WARRANTY; without even the implied warranty of\"" >> run-TexFlasher.sh
echo "echo \"MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\"" >> run-TexFlasher.sh
echo "echo \"GNU General Public License for more details.\"" >> run-TexFlasher.sh
echo "echo \"\"">> run-TexFlasher.sh
echo "python \$TEXFLASHDIR/.TexFlasher/leitner.py" >> run-TexFlasher.sh
chmod a+x run-TexFlasher.sh
chmod a+x .TexFlasher/leitner.py
echo -n "Would you like to create a desktop shortcut? (Y/n): "
read ANSWER
if [ "$ANSWER" != "n" ]; then
echo "Creating link on Desktop."
if [ -f TexFlasher.desktop ]; then
rm TexFlasher.desktop
fi
echo "[Desktop Entry]" >> TexFlasher.desktop
echo "Version=6.0" >> TexFlasher.desktop
echo "Type=Application" >> TexFlasher.desktop
echo "Terminal=false" >> TexFlasher.desktop
echo "Exec=$PWD/run-TexFlasher.sh" >> TexFlasher.desktop
echo "Name=TexFlasher" >> TexFlasher.desktop
echo "Comment=Flashcard manager with latex support." >> TexFlasher.desktop
echo "Icon=$PWD/.TexFlasher/pictures/icon.png" >> TexFlasher.desktop
echo "Categories=Office;Application;" >> TexFlasher.desktop
chmod a+x TexFlasher.desktop
cp TexFlasher.desktop ~/.local/share/applications
mv TexFlasher.desktop ~/Desktop/
fi
echo
echo "Writing settings to HD"
echo "#This file was created automatically by 'install.sh'." >> settings
echo "[TexFlasher]" >> settings
echo "user: $USERNAME" >> settings
echo
if [ ! -f .TexFlasher/config.xml ]; then
echo "<config><FlashFolder created=\"2012-05-07 14:49:00\" filename=\"$PWD/Example-elDG/Vorbereitung.tex\" lastReviewed=\"2012-05-07 14:49:00\"/></config>"
echo "<config><FlashFolder created=\"2012-05-07 14:49:00\" filename=\"$PWD/Example-elDG/Vorbereitung.tex\" lastReviewed=\"2012-05-07 14:49:00\"/></config>" >> .TexFlasher/config.xml
fi
# echo "Please run TexFlasher by typing \"./run-TexFlasher.sh\" in your bash."
# echo
# echo "Insallation complete. Please enjoy the TexFlasher."
exit 0