1 # Copyright © 2016-2019 RebornOS
3 # This file is part of RebornOS.
5 # Reborn OS is free software; you can redistribute it and/or modify
6 # it under the terms of the GNU General Public License as published by
7 # the Free Software Foundation; either version 3 of the License, or
8 # (at your option) any later version.
10 # Reborn OS is distributed in the hope that it will be useful,
11 # but WITHOUT ANY WARRANTY; without even the implied warranty of
12 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 # GNU General Public License for more details.
15 # The following additional terms are in effect as per Section 7 of the license:
17 # The preservation of all legal notices and author attributions in
18 # the material or in the Appropriate Legal Notices displayed
19 # by works containing it is required.
21 # You should have received a copy of the GNU General Public License
22 # along with Reborn OS; If not, see <http://www.gnu.org/licenses/>.
25 ##############################
26 # Script to download and install Cnchi #
27 ##############################
31 export CNCHI_GIT_BRANCH="0.16.21"
32 export CNCHI_GIT_URL="https://github.com/Antergos/Cnchi/archive/${CNCHI_GIT_BRANCH}.zip"
33 export script_path="/usr/share"
34 export REBORN="/usr/share/cnchi/reborn"
38 echo "Please select your preferred course of action:"
40 options=("Remove all instances of Cnchi from my system" "Build Cnchi" "Quit")
41 select opt in "${options[@]}"
44 "Remove all instances of Cnchi from my system")
50 *) echo "ERROR!!! ERROR!!!! SOUND THE ALARM!!!"
51 echo "Sadly, option $REPLY is not possible! Please select either option 1, 2, or 3 instead. Thank you!";;
56 # Removing Cnchi files if they exist
59 echo "REMOVING ALL INSTALLED INSTANCES OF CNCHI..."
60 if [ -f /usr/share/cnchi/bin/cnchi ]; then
61 rm -rf /usr/share/cnchi
64 rm -f /usr/bin/cnchi-start.sh
65 rm -f /usr/share/applications/antergos-install.desktop
66 rm -f /usr/share/applications/cnchi.desktop
67 rm -f /usr/share/pixmaps/cnchi.png
71 # Downloading and installing Cnchi
74 echo "#########################################################"
75 echo "########## DOWNLOADING & INSTALLING CNCHI... ############"
76 echo "#########################################################"
78 wget "${CNCHI_GIT_URL}" -O ${script_path}/cnchi-git.zip
79 unzip ${script_path}/cnchi-git.zip -d ${script_path}
80 rm -f ${script_path}/cnchi-git.zip
81 CNCHI_SRC="${script_path}/Cnchi-${CNCHI_GIT_BRANCH}"
82 install -d ${script_path}/{cnchi,locale}
83 install -Dm755 "${CNCHI_SRC}/bin/cnchi" "/usr/bin/cnchi"
85 echo "COPIED STARTUP FILE OVER"
87 install -Dm755 "${CNCHI_SRC}/cnchi.desktop" "/usr/share/applications/cnchi.desktop"
89 echo "COPIED DESKTOP FILE OVER"
91 install -Dm644 "${CNCHI_SRC}/data/images/antergos/antergos-icon.png" "/usr/share/pixmaps/cnchi.png"
93 echo "COPIED CNCHI ICON OVER"
95 # TODO: This should be included in Cnchi's src code as a separate file
96 # (as both files are needed to run cnchi)
97 sed -r -i 's|\/usr.+ -v|pkexec /usr/share/cnchi/bin/cnchi -s bugsnag|g' "/usr/bin/cnchi"
99 echo "MODIFIED STARTUP COMMAND FOR CNCHI"
101 for i in ${CNCHI_SRC}/src ${CNCHI_SRC}/bin ${CNCHI_SRC}/data ${CNCHI_SRC}/scripts ${CNCHI_SRC}/ui; do
102 cp -R ${i} "${script_path}/cnchi/"
104 echo "COPIED MAIN CNCHI'S SUBDIRECTORIES OVER TO BUILD FOLDER"
107 for files in ${CNCHI_SRC}/po/*; do
108 if [ -f "$files" ] && [ "$files" != 'po/cnchi.pot' ]; then
109 STRING_PO=`echo ${files#*/}`
110 STRING=`echo ${STRING_PO%.po}`
111 mkdir -p /usr/share/locale/${STRING}/LC_MESSAGES
112 msgfmt $files -o /usr/share/locale/${STRING}/LC_MESSAGES/cnchi.mo
113 echo "${STRING} installed..."
114 echo "CNCHI IS NOW BUILT"
117 rm -rf ${script_path}/Cnchi-${CNCHI_GIT_BRANCH}
120 # Ask whether or not to use experimental files for Cnchi
124 echo "Please select your preferred course of action:"
126 options=("Use our official Cnchi files" "Do not use modified Cnchi files" "Use your own files instead" "Setup System for Reborn installation" "Quit")
127 select opt in "${options[@]}"
130 "Use our official Cnchi files")
131 DOWNLOAD_SIMPLE;break;;
132 "Do not use modified Cnchi files")
134 "Use your own files instead")
136 "Setup System for Reborn installation")
137 DOWNLOAD_ADVANCED;break;;
141 *) echo "ERROR!!! ERROR!!!! SOUND THE ALARM!!!"
142 echo "Sadly, option $REPLY is not possible! Please select either option 1, 2, 3, 4, or 5 instead. Thank you!";;
147 # Use plain old Antergos files (useful for testing sometimes)
152 echo "Nice choice! I know I use this one sometimes to test things myself as well, when I need more control with files"
153 echo "Just remember - have fun and continue on! Your work truly means a lot to us at Reborn OS."
155 echo "DOWNLOADING A FEW FILES TO HELP CNCHI START PROPERLY FOR YOU..."
162 git clone https://gitlab.com/RebornOS/RebornOS.git --recursive
165 if [ -f /usr/bin/cnchi-start.sh ]; then
166 rm -f /usr/bin/cnchi-start.sh
168 wget https://gitlab.com/RebornOS/RebornOS/raw/master/airootfs/usr/bin/cnchi-start.sh
169 chmod +x /usr/bin/cnchi-start.sh
171 cd /usr/share/applications/
172 if [ -f /usr/share/applications/cnchi.desktop ]; then
173 rm -f /usr/share/applications/cnchi.desktop
175 if [ -f /usr/share/applications/antergos-install.desktop ]; then
176 rm -f /usr/share/applications/antergos-install.desktop
178 cp $REBORN/RebornOS/airootfs/usr/share/applications/antergos-install.desktop /usr/share/applications/
180 echo "DONE WITH EVERYTHING!"
181 echo "ENJOY ANTERGOS' CNCHI"
184 # Use your own files for Cnchi
188 echo "Fabulous! I see you're quite adventurous' :)"
189 echo "Well, have fun and happy hacking."
190 yad --center --width=350 --height=100 --form --separator='' --title="Select" --text="Select Disired Directory" --save --field="":CDIR > /tmp/reborn-directory.txt
191 SAVING=$(sed '1q;d' /tmp/reborn-directory.txt)
194 echo "DOWNLOADING SPECIAL IMAGE FILES FOR CNCHI. THEN INSTALLING YOUR FILES AS WELL..."
201 git clone https://gitlab.com/RebornOS/RebornOS.git --recursive
202 cp -r $SAVING $REBORN/Cnchi
203 mv $REBORN/RebornOS/images $REBORN/images
206 if [ -f /usr/bin/cnchi-start.sh ]; then
207 rm -f /usr/bin/cnchi-start.sh
209 wget https://gitlab.com/RebornOS/RebornOS/raw/master/airootfs/usr/bin/cnchi-start.sh
210 chmod +x /usr/bin/cnchi-start.sh
212 cd /usr/share/applications/
213 if [ -f /usr/share/applications/cnchi.desktop ]; then
214 rm -f /usr/share/applications/cnchi.desktop
216 if [ -f /usr/share/applications/antergos-install.desktop ]; then
217 rm -f /usr/share/applications/antergos-install.desktop
219 cp $REBORN/RebornOS/airootfs/usr/share/applications/antergos-install.desktop /usr/share/applications/
221 rm -f /tmp/reborn-directory.txt
225 # Download Reborn's normal Cnchi files
229 echo "Fabulous! Checking out Reborn I see :)"
230 echo "Well, have fun and happy hacking."
232 echo "DOWNLOADING SPECIAL REBORN FILES FOR CNCHI..."
239 git clone https://gitlab.com/RebornOS/RebornOS.git --recursive
240 mv $REBORN/RebornOS/Cnchi $REBORN/Cnchi
241 mv $REBORN/RebornOS/images $REBORN/images
244 if [ -f /usr/bin/cnchi-start.sh ]; then
245 rm -f /usr/bin/cnchi-start.sh
247 wget https://gitlab.com/RebornOS/RebornOS/raw/master/airootfs/usr/bin/cnchi-start.sh
248 chmod +x /usr/bin/cnchi-start.sh
250 cd /usr/share/applications/
251 if [ -f /usr/share/applications/cnchi.desktop ]; then
252 rm -f /usr/share/applications/cnchi.desktop
254 if [ -f /usr/share/applications/antergos-install.desktop ]; then
255 rm -f /usr/share/applications/antergos-install.desktop
257 cp $REBORN/RebornOS/airootfs/usr/share/applications/antergos-install.desktop /usr/share/applications/
263 DONWLOAD_ADVANCED() {
266 echo "Fabulous! Welcome to Reborn :)"
267 echo "Well, have fun and happy hacking."
269 echo "DOWNLOADING SPECIAL REBORN FILES FOR CNCHI..."
276 git clone https://gitlab.com/RebornOS/RebornOS.git --recursive
277 mv $REBORN/RebornOS/Cnchi $REBORN/Cnchi
278 mv $REBORN/RebornOS/images $REBORN/images
281 if [ -f /usr/bin/cnchi-start.sh ]; then
282 rm -f /usr/bin/cnchi-start.sh
284 wget https://gitlab.com/RebornOS/RebornOS/raw/master/airootfs/usr/bin/cnchi-start.sh
285 chmod +x /usr/bin/cnchi-start.sh
287 cd /usr/share/applications/
288 if [ -f /usr/share/applications/cnchi.desktop ]; then
289 rm -f /usr/share/applications/cnchi.desktop
291 if [ -f /usr/share/applications/antergos-install.desktop ]; then
292 rm -f /usr/share/applications/antergos-install.desktop
294 cp $REBORN/RebornOS/airootfs/usr/share/applications/antergos-install.desktop /usr/share/applications/
295 #Use lightdm.conf from local direcectory instead of default one
296 echo "Removing unnecessary lightdm.conf"
297 rm /etc/lightdm/lightdm.conf
298 echo "Copying correct lightdm.conf file over"
299 cp $REBORN/airootfs/etc/lightdm/lightdm.conf /etc/lightdm/
302 #Use sddm.conf from local direcectory instead of default one
303 echo "Removing unnecessary sddm.conf"
305 echo "Copying correct sddm.conf file over"
306 cp $REBORN/etc/sddm.conf /etc/
309 #Copy Antergos Mirrorlist
310 echo "Setting up Antergos and Reborn Mirrorlist"
311 mkdir -p /etc/pacman.d
312 cp $REBORN/airootfs/etc/antergos-mirrorlist /etc/pacman.d/
313 cp $REBORN/airootfs/etc/reborn-mirrorlist /etc/pacman.d/
316 #Copy pacman-init.service over
317 echo "Copying pacman-init.service"
318 cp $REBORN/pacman-init.service /etc/systemd/system/
321 #Replace pacman.conf with Reborn's
322 echo "Replacing pacman.conf with Reborn's"
324 cp $REBORN/Cnchi/pacman.conf /airootfs/etc/
325 cp $REBORN/Cnchi/pacman.conf /usr/share/cnchi/
326 cp $REBORN/Cnchi/pacman2.conf /
327 mv /pacman2.conf /tmp/pacman.conf
333 # Customize Cnchi for Reborn OS
337 echo "MOVING DOWNLOADED FILES OVER..."
342 echo "Moving Cnchi files over..."
344 cp $REBORN/Cnchi/packages.xml /usr/share/cnchi/data/
345 cp $REBORN/Cnchi/pacman.tmpl /usr/share/cnchi/data/
346 cp $REBORN/Cnchi/features_info.py /usr/share/cnchi/src/
347 cp $REBORN/Cnchi/features.py /usr/share/cnchi/src/pages/
348 cp $REBORN/Cnchi/desktop_info.py /usr/share/cnchi/src/
349 cp $REBORN/Cnchi/grub2.py /usr/share/cnchi/src/installation/boot/
350 cp $REBORN/Cnchi/10_antergos /usr/share/cnchi/scripts/
351 cp $REBORN/Cnchi/systemd_boot.py /usr/share/cnchi/src/installation/boot/
352 cp $REBORN/Cnchi/postinstall.sh /usr/share/cnchi/scripts/
353 cp $REBORN/Cnchi/info.py /usr/share/cnchi/src/
354 cp $REBORN/Cnchi/show_message.py /usr/share/cnchi/src/
355 cp $REBORN/Cnchi/slides.py /usr/share/cnchi/src/pages/
356 cp $REBORN/Cnchi/check.py /usr/share/cnchi/src/pages/
357 cp $REBORN/Cnchi/welcome.py /usr/share/cnchi/src/pages/
358 cp $REBORN/Cnchi/antergos-logo-mini2.png /usr/share/cnchi/data/images/antergos/
359 cp $REBORN/Cnchi/20-intel.conf /usr/share/cnchi/
360 cp $REBORN/Cnchi/lightdm-webkit2-greeter.conf /usr/share/cnchi/
361 cp $REBORN/Cnchi/1.png /usr/share/cnchi/data/images/slides/
362 cp $REBORN/Cnchi/2.png /usr/share/cnchi/data/images/slides/
363 cp $REBORN/Cnchi/3.png /usr/share/cnchi/data/images/slides/
364 cp $REBORN/Cnchi/sddm.conf /usr/share/cnchi/
365 cp $REBORN/airootfs/usr/share/applications/cnchi.png /usr/share/pixmaps/
366 cp $REBORN/Cnchi/antergos-icon.png /usr/share/cnchi/data/images/antergos/antergos-icon.png
367 cp $REBORN/scripts/tint2-start.desktop /usr/share/cnchi/
368 cp $REBORN/scripts/conky-start.desktop /usr/share/cnchi/
369 cp $REBORN/scripts/obmenu-gen.desktop /usr/share/cnchi/
370 cp $REBORN/scripts/plymouth-reborn.desktop /usr/share/cnchi/
371 cp $REBORN/scripts/mate-panel.desktop /usr/share/cnchi/
372 cp $REBORN/scripts/plymouth.sh /usr/share/cnchi/
373 cp $REBORN/scripts/flatpak.sh /usr/share/cnchi/
374 cp $REBORN/scripts/pkcon.sh /usr/share/cnchi/
375 cp $REBORN/scripts/pkcon2.sh /usr/share/cnchi/
376 cp $REBORN/scripts/flatpak.desktop /usr/share/cnchi/
377 cp $REBORN/scripts/update.desktop /usr/share/cnchi/
378 cp $REBORN/scripts/openbox-config.sh /usr/share/cnchi/
379 cp $REBORN/scripts/deepin-fix.sh /usr/share/cnchi/
380 cp $REBORN/scripts/deepin-fix.service /usr/share/cnchi/
381 cp $REBORN/images/pantheon.png /usr/share/cnchi/data/images/desktops/
382 cp $REBORN/images/apricity.png /usr/share/cnchi/data/images/desktops/
383 cp $REBORN/images/deepin.png /usr/share/cnchi/data/images/desktops/
384 cp $REBORN/images/cinnamon.png /usr/share/cnchi/data/images/desktops/
385 cp $REBORN/images/windows.png /usr/share/cnchi/data/images/desktops/
386 cp $REBORN/images/kde.png /usr/share/cnchi/data/images/desktops/
387 cp $REBORN/images/i3.png /usr/share/cnchi/data/images/desktops/
388 cp $REBORN/images/lxqt.png /usr/share/cnchi/data/images/desktops/
389 cp $REBORN/images/openbox.png /usr/share/cnchi/data/images/desktops/
390 cp $REBORN/images/enlightenment.png /usr/share/cnchi/data/images/desktops/
391 cp $REBORN/images/xfce.png /usr/share/cnchi/data/images/desktops/
392 cp $REBORN/images/desktop-environment-apricity.svg /usr/share/cnchi/data/icons/scalable/
393 cp $REBORN/images/desktop-environment-pantheon.svg /usr/share/cnchi/data/icons/scalable/
394 cp $REBORN/images/desktop-environment-windows.svg /usr/share/cnchi/data/icons/scalable/
395 cp $REBORN/images/desktop-environment-budgie.svg /usr/share/cnchi/data/icons/scalable/
396 cp $REBORN/images/desktop-environment-i3.svg /usr/share/cnchi/data/icons/scalable/
397 cp $REBORN/Cnchi/reborn-mirrorlist /etc/pacman.d/
400 echo "Replacing Antergos mentions with Reborn"
401 sed -i "s/Antergos/Reborn/g" /usr/share/cnchi/src/pages/advanced.py
402 sed -i "s/Antergos/Reborn/g" /usr/share/cnchi/src/pages/alongside.py
403 sed -i "s/Antergos/Reborn/g" /usr/share/cnchi/src/pages/ask.py
404 sed -i "s/Antergos/Reborn/g" /usr/share/cnchi/src/pages/automatic.py
405 sed -i "s/Antergos/Reborn/g" /usr/share/cnchi/src/pages/check.py
406 sed -i "s/Antergos/Reborn/g" /usr/share/cnchi/src/pages/gtkbasebox.py
407 sed -i "s/Antergos/Reborn/g" /usr/share/cnchi/src/pages/keymap.py
408 sed -i "s/Antergos/Reborn/g" /usr/share/cnchi/src/pages/language.py
409 sed -i "s/Antergos/Reborn/g" /usr/share/cnchi/src/pages/location.py
410 sed -i "s/Antergos/Reborn/g" /usr/share/cnchi/src/installation/process.py
411 sed -i "s/Antergos/Reborn/g" /usr/share/cnchi/src/pages/slides.py
412 sed -i "s/Antergos/Reborn/g" /usr/share/cnchi/src/pages/summary.py
413 sed -i "s/Antergos/Reborn/g" /usr/share/cnchi/src/pages/timezone.py
414 sed -i "s/Antergos/Reborn/g" /usr/share/cnchi/src/pages/user_info.py
415 sed -i "s/Antergos/Reborn/g" /usr/share/cnchi/src/pages/wireless.py
416 sed -i "s/Antergos/Reborn/g" /usr/share/cnchi/src/pages/zfs.py
417 sed -i "s/Antergos/Reborn/g" /usr/share/cnchi/src/pages/desktop.py
418 sed -i "s/gnome/deepin/g" /usr/share/cnchi/src/pages/desktop.py
419 #sed -i "s/Antergos/Reborn/g" ${work_dir}/${arch}/airootfs/usr/share/cnchi/src/encfs.py
420 sed -i "s/Antergos/Reborn/g" /usr/share/cnchi/src/main_window.py
427 echo "YAY! Thank you for your help in maintaining Reborn."
428 echo "We surely need it! So have fun, and feel free to"
429 echo "message me (Keegan) anytime you want. Got questions?"
430 echo "Just ask! Thanks, and good luck."
439 export -f QUESTION DOWNLOAD_SIMPLE DOWNLOAD_ADVANCED ASK CUSTOMIZE INSTALL REMOVE RUN ANTERGOS