2 # -*- coding: utf-8 -*-
6 # Copyright © 2013-2016 Antergos
8 # Modifications by Rafael from RebornOS in 2020
10 # This file is part of Cnchi.
12 # Cnchi is free software; you can redistribute it and/or modify
13 # it under the terms of the GNU General Public License as published by
14 # the Free Software Foundation; either version 3 of the License, or
15 # (at your option) any later version.
17 # Cnchi is distributed in the hope that it will be useful,
18 # but WITHOUT ANY WARRANTY; without even the implied warranty of
19 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20 # GNU General Public License for more details.
22 # The following additional terms are in effect as per Section 7 of the license:
24 # The preservation of all legal notices and author attributions in
25 # the material or in the Appropriate Legal Notices displayed
26 # by works containing it is required.
28 # You should have received a copy of the GNU General Public License
29 # along with Cnchi; If not, see <http://www.gnu.org/licenses/>.
31 # Set xorg config files
33 cp /usr/share/cnchi/scripts/postinstall/50-synaptics.conf ${CN_DESTDIR}/etc/X11/xorg.conf.d/50-synaptics.conf
34 cp /usr/share/cnchi/scripts/postinstall/99-killX.conf ${CN_DESTDIR}/etc/X11/xorg.conf.d/99-killX.conf
36 # Fix sensitivity for chromebooks
37 if lsmod | grep -q cyapa; then
38 cp /usr/share/cnchi/scripts/postinstall/50-cros-touchpad.conf ${CN_DESTDIR}/etc/X11/xorg.conf.d/50-cros-touchpad.conf
44 cp /usr/share/cnchi/scripts/postinstall/xscreensaver ${CN_DESTDIR}/home/${CN_USER_NAME}/.xscreensaver
45 cp ${CN_DESTDIR}/home/${CN_USER_NAME}/.xscreensaver ${CN_DESTDIR}/etc/skel
47 if [[ -f ${CN_DESTDIR}/etc/xdg/autostart/xscreensaver.desktop ]]; then
48 rm ${CN_DESTDIR}/etc/xdg/autostart/xscreensaver.desktop
53 # Set gsettings input-source
55 CN_INPUT_SCHEMA="${CN_DESTDIR}/usr/share/glib-2.0/schemas/90_rebornos.input-sources.gschema.override"
56 if [[ "${CN_KEYBOARD_LAYOUT}" != '' ]]; then
57 if [[ "${CN_KEYBOARD_VARIANT}" != '' ]]; then
58 CN_KEYBOARD=${CN_KEYBOARD_LAYOUT}+${CN_KEYBOARD_VARIANT}
60 CN_KEYBOARD=${CN_KEYBOARD_LAYOUT}
62 echo "[org.cinnamon.desktop.input-sources]" > ${CN_INPUT_SCHEMA}
63 echo "sources=[('xkb','${CN_KEYBOARD}')]" >> ${CN_INPUT_SCHEMA}
64 echo " " >> ${CN_INPUT_SCHEMA}
65 echo "[org.gnome.desktop.input-sources]" >> ${CN_INPUT_SCHEMA}
66 echo "sources=[('xkb','${CN_KEYBOARD}')]" >> ${CN_INPUT_SCHEMA}
69 # Set default Internet browser
70 for CN_SCHEMA_OVERRIDE in ${CN_DESTDIR}/usr/share/glib-2.0/schemas/90_rebornos*; do
71 if [ "${CN_BROWSER}" != "" ]; then
72 sed -i "s|chromium|${CN_BROWSER}|g" "${CN_SCHEMA_OVERRIDE}"
74 sed -i "s|'chromium.desktop',||g" "${CN_SCHEMA_OVERRIDE}"
78 glib-compile-schemas "${CN_DESTDIR}/usr/share/glib-2.0/schemas"
82 # Set session in .dmrc
83 echo "[Desktop]" > ${CN_DESTDIR}/home/${CN_USER_NAME}/.dmrc
84 echo "Session=$1" >> ${CN_DESTDIR}/home/${CN_USER_NAME}/.dmrc
85 chroot ${CN_DESTDIR} chown ${CN_USER_NAME}:users /home/${CN_USER_NAME}/.dmrc
89 # Set skel directory (not needed, antergos-desktop-settings does this)
90 #cp -R ${CN_DESTDIR}/home/${CN_USER_NAME}/.config ${CN_DESTDIR}/etc/skel
92 # Set .bashrc (antergos-desktop-settings can't set it because it's already in bash package)
93 if [[ -f "${CN_DESTDIR}/etc/skel/bashrc" ]]; then
94 cp ${CN_DESTDIR}/etc/skel/bashrc ${CN_DESTDIR}/etc/skel/.bashrc
95 cp ${CN_DESTDIR}/etc/skel/bashrc ${CN_DESTDIR}/home/${CN_USER_NAME}/.bashrc
99 cp -R ${CN_DESTDIR}/etc/skel/. ${CN_DESTDIR}/root
109 cinnamon_settings() {
113 # Copy menu@cinnamon.org.json to set menu icon
114 mkdir -p ${CN_DESTDIR}/home/${CN_USER_NAME}/.cinnamon/configs/menu@cinnamon.org/
115 cp -f /usr/share/cnchi/scripts/postinstall/menu@cinnamon.org.json ${CN_DESTDIR}/home/${CN_USER_NAME}/.cinnamon/configs/menu@cinnamon.org/
117 # Copy panel-launchers@cinnamon.org.json to set launchers
118 PANEL_LAUNCHER="/usr/share/cnchi/scripts/postinstall/panel-launchers@cinnamon.org.json"
119 if [[ firefox = "${CN_BROWSER}" ]]; then
120 sed -i 's|chromium|firefox|g' ${PANEL_LAUNCHER}
121 elif [ "${CN_BROWSER}" == "" ]; then
122 sed -i 's|"chromium.desktop",||g' ${PANEL_LAUNCHER}
125 mkdir -p ${CN_DESTDIR}/home/${CN_USER_NAME}/.cinnamon/configs/panel-launchers@cinnamon.org/
126 cp -f /usr/share/cnchi/scripts/postinstall/panel-launchers@cinnamon.org.json ${CN_DESTDIR}/home/${CN_USER_NAME}/.cinnamon/configs/panel-launchers@cinnamon.org/
136 mkdir -p ${CN_DESTDIR}/home/${CN_USER_NAME}/.config/xfce4/xfconf/xfce-perchannel-xml
137 cp -R ${CN_DESTDIR}/etc/xdg/xfce4/panel ${CN_DESTDIR}/etc/xdg/xfce4/helpers.rc ${CN_DESTDIR}/home/${CN_USER_NAME}/.config/xfce4
139 HELPERS_RC="${CN_DESTDIR}/home/${CN_USER_NAME}/.config/xfce4/helpers.rc"
140 if [[ ${CN_BROWSER} = "chromium" ]]; then
141 sed -i "s/WebBrowser=firefox/WebBrowser=chromium/" ${HELPERS_RC}
142 elif [ "${CN_BROWSER}" == "" ]; then
143 sed -i "s/WebBrowser=firefox//" ${HELPERS_RC}
148 # Add lxpolkit to autostart apps
149 cp /etc/xdg/autostart/lxpolkit.desktop ${CN_DESTDIR}/home/${CN_USER_NAME}/.config/autostart
158 # Set Numix theme in oblogout
159 if [[ -f /etc/oblogout.conf ]]; then
160 sed -i 's|buttontheme = oxygen|buttontheme = Numix|g' "${CN_DESTDIR}/etc/oblogout.conf"
170 # Force QtCurve to use our theme
171 rm -R ${CN_DESTDIR}/usr/share/kstyle/themes/qtcurve.themerc
173 # Setup user defaults
174 #if [ -f "${CN_DESTDIR}/usr/share/antergos-kde-setup/install.sh" ]; then
175 # chroot ${CN_DESTDIR} /usr/share/antergos-kde-setup/install.sh ${CN_USER_NAME}
176 #elif [ -f "${CN_DESTDIR}/usr/share/antergos-desktop" ]; then
177 # chroot ${CN_DESTDIR} /usr/bin/antergos-desktop plasma ${CN_USER_NAME}
180 cp ${CN_DESTDIR}/etc/skel/.gtkrc-2.0-kde4 ${CN_DESTDIR}/root
181 chroot ${CN_DESTDIR} "ln -s /root/.gtkrc-2.0-kde4 /root/.gtkrc-2.0"
183 # Set default directories
184 chroot ${CN_DESTDIR} su -c xdg-user-dirs-update ${CN_USER_NAME}
193 # Set MintMenu Favorites
194 APP_LIST="/usr/share/cnchi/scripts/postinstall/applications.list"
195 if [[ "${CN_BROWSER}" = 'firefox' ]]; then
196 sed -i 's|chromium|firefox|g' ${APP_LIST}
197 elif [ "${CN_BROWSER}" == "" ]; then
198 sed -i 's|location:/usr/share/applications/chromium.desktop||g' ${APP_LIST}
201 cp ${APP_LIST} "${CN_DESTDIR}/usr/lib/linuxmint/mintMenu/applications.list"
203 # Work-around for bug in mate-panel
204 CN_POST_INSTALL_DIR=/usr/share/cnchi/scripts/postinstall
205 CN_HOTFIX_SCRIPT="${CN_POST_INSTALL_DIR}/first-boot-hotfix.sh"
206 CN_HOTFIX_DESKTOP="${CN_POST_INSTALL_DIR}/first-boot-hotfix.desktop"
207 cp "${CN_HOTFIX_SCRIPT}" "${CN_DESTDIR}/usr/bin"
208 mkdir -p "${CN_DESTDIR}/home/${CN_USER_NAME}/.config/autostart"
209 cp "${CN_HOTFIX_DESKTOP}" "${CN_DESTDIR}/home/${CN_USER_NAME}/.config/autostart"
210 chmod +x "${CN_DESTDIR}/usr/bin/first-boot-hotfix.sh"
226 enlightenment_settings() {
230 # http://git.enlightenment.org/core/enlightenment.git/plain/data/tools/enlightenment_remote
232 # Setup user defaults
233 #chroot ${CN_DESTDIR} /usr/share/antergos-enlightenment-setup/install.sh ${CN_USER_NAME}
234 #chroot ${CN_DESTDIR} /usr/bin/antergos-desktop enlightenment ${CN_USER_NAME}
236 # Set Keyboard layout
237 E_CFG="/home/${CN_USER_NAME}/.e/e/config/standard/e.cfg"
238 E_SRC="/home/${CN_USER_NAME}/.e/e/config/standard/e.src"
240 ${CN_DESTDIR}/usr/bin/eet -d ${E_CFG} config ${E_SRC}
241 sed -i 's/"us"/"${CN_KEYBOARD_LAYOUT}"/' ${E_SRC}
242 if [[ "${CN_KEYBOARD_VARIANT}" != '' ]]; then
243 sed -i 's/"basic"/"${CN_KEYBOARD_VARIANT}"/' ${E_SRC}
245 ${CN_DESTDIR}/usr/bin/eet -e ${E_CFG} config ${E_SRC} 1
247 set_dmrc enlightenment
249 echo "QT_STYLE_OVERRIDE=gtk" >> ${CN_DESTDIR}/etc/environment
251 # Add lxpolkit to autostart apps
252 cp /etc/xdg/autostart/lxpolkit.desktop ${CN_DESTDIR}/home/${CN_USER_NAME}/.config/autostart
270 # Specific user configurations
271 if [[ -f /usr/share/applications/firefox.desktop ]]; then
272 export CN_BROWSER=firefox
273 elif [[ -f /usr/share/applications/chromium.desktop ]]; then
274 export CN_BROWSER=chromium
279 # Workaround for LightDM bug https://bugs.launchpad.net/lightdm/+bug/1069218
280 sed -i 's|UserAccounts|UserList|g' "${CN_DESTDIR}/etc/lightdm/users.conf"
282 ## Unmute alsa channels
283 #chroot "${CN_DESTDIR}" amixer -c 0 -q set Master playback 50% unmute
285 # Configure touchpad. Skip with base installs
286 if [[ "base" != "${CN_DESKTOP}" ]]; then
290 # Fix ugly styles for Qt applications when running under GTK-based desktops and Qt 5.7+
291 if [[ kde != "${CN_DESKTOP}" && lxqt != "${CN_DESKTOP}" ]]; then
292 mkdir -p "${CN_DESTDIR}/home/${CN_USER_NAME}/.config/qt5ct" "${CN_DESTDIR}/etc/skel/qt5ct"
293 cp /usr/share/cnchi/scripts/postinstall/qt5ct.conf "${CN_DESTDIR}/etc/skel/qt5ct"
294 cp /usr/share/cnchi/scripts/postinstall/qt5ct.conf "${CN_DESTDIR}/home/${CN_USER_NAME}/.config/qt5ct"
297 # Monkey patch session wrapper
298 cp /usr/share/cnchi/scripts/postinstall/Xsession "${CN_DESTDIR}/etc/lightdm"
299 chmod +x "${CN_DESTDIR}/etc/lightdm/Xsession"
301 # Configure fontconfig
302 FONTCONFIG_FILE="/usr/share/cnchi/scripts/fonts.conf"
303 if [[ -f "${FONTCONFIG_FILE}" ]]; then
304 FONTCONFIG_DIR="${CN_DESTDIR}/home/${CN_USER_NAME}/.config/fontconfig"
305 mkdir -p "${FONTCONFIG_DIR}"
306 cp "${FONTCONFIG_FILE}" "${FONTCONFIG_DIR}"
309 # Set RebornOS name in filesystem files
310 cp /etc/arch-release "${CN_DESTDIR}/etc/"
311 cp /etc/os-release "${CN_DESTDIR}/etc/"
312 sed -i 's|Arch|RebornOS|g' "${CN_DESTDIR}/etc/issue"
314 # Set common desktop settigns
317 # Set desktop-specific settings
318 ${CN_DESKTOP}_settings
320 # Set some environment vars
321 env_files=("${CN_DESTDIR}/etc/environment"
322 "${CN_DESTDIR}/home/${CN_USER_NAME}/.bashrc"
323 "${CN_DESTDIR}/etc/skel/.bashrc"
324 "${CN_DESTDIR}/etc/profile")
326 for file in "${env_files[@]}"
328 echo "# ---> Added by Cnchi RebornOS Installer Gnome based <---" >> "${file}"
329 if [ "${CN_BROWSER}" != "" ]; then
330 echo "BROWSER=/usr/bin/${CN_BROWSER}" >> "${file}"
332 echo "EDITOR=/usr/bin/nano" >> "${file}"
333 echo "# ---> End added by Cnchi RebornOS Installer Gnome based <---" >> "${file}"
336 # Uncomplicated Firewall Workaround (Rafael from RebornOS)
337 cp /usr/share/cnchi/gufw.svg ${CN_DESTDIR}/usr/share/icons/default/gufw.svg
338 cp /usr/share/cnchi/gufw.png ${CN_DESTDIR}/usr/share/icons/hicolor/48x48/apps/gufw.png
339 cp /usr/share/cnchi/gufw.desktop ${CN_DESTDIR}/usr/share/applications/gufw.desktop
341 # reborn-mirrorlist permission change
342 chroot ${CN_DESTDIR} chmod 644 /etc/pacman.d/reborn-mirrorlist
344 # Configure makepkg so that it doesn't compress packages after building.
345 # Most users are building packages to install them locally so there's no need for compression.
346 sed -i "s|^PKGEXT='.pkg.tar.xz'|PKGEXT='.pkg.tar'|g" "${CN_DESTDIR}/etc/makepkg.conf"
348 # Set lightdm-webkit2-greeter in lightdm.conf. This should have been done here (not in the pkg) all along.
349 if [[ deepin = "${CN_DESKTOP}" ]]; then
350 rm ${CN_DESTDIR}/etc/lightdm/lightdm.conf
351 cp /etc/lightdm/lightdm.conf ${CN_DESTDIR}/etc/lightdm/
352 # chroot ${CN_DESTDIR} sudo pacman -Rdd deepin-cosmic-reborn --noconfirm
353 # chroot ${CN_DESTDIR} sudo pacman -Rdd common-cosmic-reborn --noconfirm
354 # chroot ${CN_DESTDIR} sudo pacman -Rdd graphic-cosmic-reborn --noconfirm
355 # chroot ${CN_DESTDIR} sudo pacman -Rdd qt5ct --noconfirm --> Not installed now
356 cp /usr/share/cnchi/flatpak.sh ${CN_DESTDIR}/usr/bin/
357 cp /usr/share/cnchi/pkcon.sh ${CN_DESTDIR}/usr/bin/
358 cp /usr/share/cnchi/pkcon2.sh ${CN_DESTDIR}/usr/bin/
359 cp /usr/share/cnchi/flatpak.desktop ${CN_DESTDIR}/usr/share/applications/
360 cp /usr/share/cnchi/update.desktop ${CN_DESTDIR}/etc/xdg/autostart/
361 cp /usr/share/cnchi/updating.sh ${CN_DESTDIR}/usr/bin/
362 cp /usr/share/cnchi/deepin-fix.sh ${CN_DESTDIR}/usr/bin/
363 cp /usr/share/cnchi/deepin-fix.service ${CN_DESTDIR}/etc/systemd/system/
364 chroot ${CN_DESTDIR} sudo systemctl enable deepin-fix.service
365 chroot ${CN_DESTDIR} systemctl enable earlyoom
366 chroot ${CN_DESTDIR} systemctl enable ufw
369 if [[ gnome = "${CN_DESKTOP}" ]]; then
370 chroot ${CN_DESTDIR} systemctl -fq enable gdm
371 # chroot ${CN_DESTDIR} sudo pacman -Rdd gnome-cosmic-reborn --noconfirm
372 # chroot ${CN_DESTDIR} sudo pacman -Rdd common-cosmic-reborn --noconfirm
373 # chroot ${CN_DESTDIR} sudo pacman -Rdd graphic-cosmic-reborn --noconfirm
374 cp /usr/share/cnchi/flatpak.sh ${CN_DESTDIR}/usr/bin/
375 cp /usr/share/cnchi/pkcon.sh ${CN_DESTDIR}/usr/bin/
376 cp /usr/share/cnchi/pkcon2.sh ${CN_DESTDIR}/usr/bin/
377 cp /usr/share/cnchi/flatpak.desktop ${CN_DESTDIR}/usr/share/applications/
378 cp /usr/share/cnchi/update.desktop ${CN_DESTDIR}/etc/xdg/autostart/
379 cp /usr/share/cnchi/updating.sh ${CN_DESTDIR}/usr/bin/
380 echo "# ---> Added by Cnchi RebornOS Installer Gnome based for Gnome Desktop <---" >> ${CN_DESTDIR}/etc/environment
381 echo "QT_QPA_PLATFORMTHEME=qt5ct" >> ${CN_DESTDIR}/etc/environment
382 echo "# ---> End added by Cnchi RebornOS Installer Gnome based for Gnome Desktop <---" >> ${CN_DESTDIR}/etc/environment
383 chroot ${CN_DESTDIR} systemctl enable earlyoom
384 chroot ${CN_DESTDIR} systemctl enable ufw
385 cp /usr/share/cnchi/101_gnome.gschema.override ${CN_DESTDIR}/usr/share/glib-2.0/schemas/
386 chroot ${CN_DESTDIR} /usr/bin/glib-compile-schemas /usr/share/glib-2.0/schemas
389 if [[ apricity = "${CN_DESKTOP}" ]]; then
390 chroot ${CN_DESTDIR} systemctl -fq enable gdm
391 # chroot ${CN_DESTDIR} sudo pacman -Rdd gnome-cosmic-reborn --noconfirm
392 # chroot ${CN_DESTDIR} sudo pacman -Rdd common-cosmic-reborn --noconfirm
393 # chroot ${CN_DESTDIR} sudo pacman -Rdd graphic-cosmic-reborn --noconfirm
394 cp /usr/share/cnchi/flatpak.sh ${CN_DESTDIR}/usr/bin/
395 cp /usr/share/cnchi/pkcon.sh ${CN_DESTDIR}/usr/bin/
396 cp /usr/share/cnchi/pkcon2.sh ${CN_DESTDIR}/usr/bin/
397 cp /usr/share/cnchi/flatpak.desktop ${CN_DESTDIR}/usr/share/applications/
398 cp /usr/share/cnchi/update.desktop ${CN_DESTDIR}/etc/xdg/autostart/
399 cp /usr/share/cnchi/updating.sh ${CN_DESTDIR}/usr/bin/
400 echo "# ---> Added by Cnchi RebornOS Installer Gnome based for Apricity Desktop <---" >> ${CN_DESTDIR}/etc/environment
401 echo "QT_QPA_PLATFORMTHEME=qt5ct" >> ${CN_DESTDIR}/etc/environment
402 echo "# ---> End added by Cnchi RebornOS Installer Gnome based for Apricity Desktop <---" >> ${CN_DESTDIR}/etc/environment
403 chroot ${CN_DESTDIR} systemctl enable earlyoom
404 chroot ${CN_DESTDIR} systemctl enable ufw
407 if [[ kde = "${CN_DESKTOP}" ]]; then
408 chroot ${CN_DESTDIR} systemctl -fq enable sddm
409 cp /usr/share/cnchi/sddm.conf ${CN_DESTDIR}/etc/
410 # chroot ${CN_DESTDIR} sudo pacman -Rdd kde-cosmic-reborn --noconfirm
411 # chroot ${CN_DESTDIR} sudo pacman -Rdd common-cosmic-reborn --noconfirm
412 # chroot ${CN_DESTDIR} sudo pacman -Rdd graphic-cosmic-reborn --noconfirm
413 cp /usr/share/cnchi/flatpak.sh ${CN_DESTDIR}/usr/bin/
414 cp /usr/share/cnchi/pkcon.sh ${CN_DESTDIR}/usr/bin/
415 cp /usr/share/cnchi/pkcon2.sh ${CN_DESTDIR}/usr/bin/
416 cp /usr/share/cnchi/flatpak.desktop ${CN_DESTDIR}/usr/share/applications/
417 cp /usr/share/cnchi/update.desktop ${CN_DESTDIR}/etc/xdg/autostart/
418 cp /usr/share/cnchi/updating.sh ${CN_DESTDIR}/usr/bin/
419 chroot ${CN_DESTDIR} systemctl enable earlyoom
420 chroot ${CN_DESTDIR} systemctl enable ufw
423 if [[ budgie = "${CN_DESKTOP}" ]]; then
424 chroot ${CN_DESTDIR} systemctl -fq enable lightdm
425 sed -i 's/^webkit_theme\s*=\s*\(.*\)/webkit_theme = lightdm-webkit-theme-aether #\1/g' ${CN_DESTDIR}/etc/lightdm/lightdm-webkit2-greeter.conf
426 sed -i 's/^\(#?greeter\)-session\s*=\s*\(.*\)/greeter-session = lightdm-webkit2-greeter #\1/ #\2g' ${CN_DESTDIR}/etc/lightdm/lightdm.conf
427 # chroot ${CN_DESTDIR} sudo pacman -Rdd budgie-cosmic-reborn --noconfirm
428 # chroot ${CN_DESTDIR} sudo pacman -Rdd common-cosmic-reborn --noconfirm
429 # chroot ${CN_DESTDIR} sudo pacman -Rdd graphic-cosmic-reborn --noconfirm
430 cp /usr/share/cnchi/flatpak.sh ${CN_DESTDIR}/usr/bin/
431 cp /usr/share/cnchi/pkcon.sh ${CN_DESTDIR}/usr/bin/
432 cp /usr/share/cnchi/pkcon2.sh ${CN_DESTDIR}/usr/bin/
433 cp /usr/share/cnchi/flatpak.desktop ${CN_DESTDIR}/usr/share/applications/
434 cp /usr/share/cnchi/update.desktop ${CN_DESTDIR}/etc/xdg/autostart/
435 cp /usr/share/cnchi/updating.sh ${CN_DESTDIR}/usr/bin/
436 echo "# ---> Added by Cnchi RebornOS Installer Gnome based for Budgie Desktop <---" >> ${CN_DESTDIR}/etc/environment
437 echo "QT_QPA_PLATFORMTHEME=qt5ct" >> ${CN_DESTDIR}/etc/environment
438 echo "# ---> End added by Cnchi RebornOS Installer Gnome based for Budgie Desktop <---" >> ${CN_DESTDIR}/etc/environment
439 chroot ${CN_DESTDIR} systemctl enable earlyoom
440 chroot ${CN_DESTDIR} systemctl enable ufw
443 if [[ i3 = "${CN_DESKTOP}" ]]; then
444 chroot ${CN_DESTDIR} systemctl -fq enable sddm
445 cp /usr/share/cnchi/sddm.conf ${CN_DESTDIR}/etc/
446 # chroot ${CN_DESTDIR} sudo pacman -Rdd i3-cosmic-reborn --noconfirm
447 # chroot ${CN_DESTDIR} sudo pacman -Rdd common-cosmic-reborn --noconfirm
448 # chroot ${CN_DESTDIR} sudo pacman -Rdd graphic-cosmic-reborn --noconfirm
449 cp /usr/share/cnchi/flatpak.sh ${CN_DESTDIR}/usr/bin/
450 cp /usr/share/cnchi/pkcon.sh ${CN_DESTDIR}/usr/bin/
451 cp /usr/share/cnchi/pkcon2.sh ${CN_DESTDIR}/usr/bin/
452 cp /usr/share/cnchi/flatpak.desktop ${CN_DESTDIR}/usr/share/applications/
453 cp /usr/share/cnchi/update.desktop ${CN_DESTDIR}/etc/xdg/autostart/
454 cp /usr/share/cnchi/updating.sh ${CN_DESTDIR}/usr/bin/
455 echo "# ---> Added by Cnchi RebornOS Installer Gnome based for i3 Desktop <---" >> ${CN_DESTDIR}/etc/environment
456 echo "QT_QPA_PLATFORMTHEME=qt5ct" >> ${CN_DESTDIR}/etc/environment
457 echo "# ---> End added by Cnchi RebornOS Installer Gnome based for i3 Desktop <---" >> ${CN_DESTDIR}/etc/environment
458 chroot ${CN_DESTDIR} systemctl enable earlyoom
459 chroot ${CN_DESTDIR} systemctl enable ufw
462 if [ -f "${CN_DESTDIR}/usr/bin/enlightenment" ]; then
463 chroot ${CN_DESTDIR} systemctl -fq enable sddm
464 cp /usr/share/cnchi/sddm.conf ${CN_DESTDIR}/etc/
465 # chroot ${CN_DESTDIR} sudo pacman -Rdd enlightenment-cosmic-reborn --noconfirm
466 # chroot ${CN_DESTDIR} sudo pacman -Rdd common-cosmic-reborn --noconfirm
467 # chroot ${CN_DESTDIR} sudo pacman -Rdd graphic-cosmic-reborn --noconfirm
468 cp /usr/share/cnchi/flatpak.sh ${CN_DESTDIR}/usr/bin/
469 cp /usr/share/cnchi/pkcon.sh ${CN_DESTDIR}/usr/bin/
470 cp /usr/share/cnchi/pkcon2.sh ${CN_DESTDIR}/usr/bin/
471 cp /usr/share/cnchi/flatpak.desktop ${CN_DESTDIR}/usr/share/applications/
472 cp /usr/share/cnchi/update.desktop ${CN_DESTDIR}/etc/xdg/autostart/
473 cp /usr/share/cnchi/updating.sh ${CN_DESTDIR}/usr/bin/
474 echo "# ---> Added by Cnchi RebornOS Installer Gnome based for Enlightenment Desktop <---" >> ${CN_DESTDIR}/etc/environment
475 echo "QT_QPA_PLATFORMTHEME=qt5ct" >> ${CN_DESTDIR}/etc/environment
476 echo "# ---> End added by Cnchi RebornOS Installer Gnome based for Enlightenment Desktop <---" >> ${CN_DESTDIR}/etc/environment
477 chroot ${CN_DESTDIR} systemctl enable earlyoom
478 chroot ${CN_DESTDIR} systemctl enable ufw
481 if [[ lxqt = "${CN_DESKTOP}" ]]; then
482 chroot ${CN_DESTDIR} systemctl -fq enable sddm
483 cp /usr/share/cnchi/sddm.conf ${CN_DESTDIR}/etc/
484 # chroot ${CN_DESTDIR} sudo pacman -Rdd lxqt-cosmic-reborn --noconfirm
485 # chroot ${CN_DESTDIR} sudo pacman -Rdd common-cosmic-reborn --noconfirm
486 # chroot ${CN_DESTDIR} sudo pacman -Rdd graphic-cosmic-reborn --noconfirm
487 cp /usr/share/cnchi/flatpak.sh ${CN_DESTDIR}/usr/bin/
488 cp /usr/share/cnchi/pkcon.sh ${CN_DESTDIR}/usr/bin/
489 cp /usr/share/cnchi/pkcon2.sh ${CN_DESTDIR}/usr/bin/
490 cp /usr/share/cnchi/flatpak.desktop ${CN_DESTDIR}/usr/share/applications/
491 cp /usr/share/cnchi/update.desktop ${CN_DESTDIR}/etc/xdg/autostart/
492 cp /usr/share/cnchi/updating.sh ${CN_DESTDIR}/usr/bin/
493 chroot ${CN_DESTDIR} systemctl enable earlyoom
494 chroot ${CN_DESTDIR} systemctl enable ufw
497 if [ -f "${CN_DESTDIR}/usr/bin/lxsession" ]; then
498 rm ${CN_DESTDIR}/etc/lightdm/lightdm-webkit2-greeter.conf
499 cp /usr/share/cnchi/lightdm-webkit2-greeter.conf ${CN_DESTDIR}/etc/lightdm/
500 chmod go=rx ${CN_DESTDIR}/var/lib/lightdm-data
501 chroot ${CN_DESTDIR} systemctl -fq enable lxdm
502 # chroot ${CN_DESTDIR} sudo pacman -Rdd openbox-cosmic-reborn --noconfirm
503 # chroot ${CN_DESTDIR} sudo pacman -Rdd common-cosmic-reborn --noconfirm
504 # chroot ${CN_DESTDIR} sudo pacman -Rdd graphic-cosmic-reborn --noconfirm
505 cp /usr/share/cnchi/flatpak.sh ${CN_DESTDIR}/usr/bin/
506 cp /usr/share/cnchi/pkcon.sh ${CN_DESTDIR}/usr/bin/
507 cp /usr/share/cnchi/pkcon2.sh ${CN_DESTDIR}/usr/bin/
508 cp /usr/share/cnchi/flatpak.desktop ${CN_DESTDIR}/usr/share/applications/
509 cp /usr/share/cnchi/update.desktop ${CN_DESTDIR}/etc/xdg/autostart/
510 cp /usr/share/cnchi/conky-start.desktop ${CN_DESTDIR}/etc/xdg/autostart/
511 cp /usr/share/cnchi/updating.sh ${CN_DESTDIR}/usr/bin/
512 cp /usr/share/cnchi/tint2-start.desktop ${CN_DESTDIR}/etc/xdg/autostart/
513 cp /usr/share/cnchi/obmenu-gen.desktop ${CN_DESTDIR}/etc/xdg/autostart/
514 cp /usr/share/cnchi/openbox-config.sh ${CN_DESTDIR}/usr/bin/
515 chroot ${CN_DESTDIR} obmenu-generator -p -i
516 chroot ${CN_DESTDIR} systemctl enable earlyoom
517 chroot ${CN_DESTDIR} systemctl enable ufw
520 if [[ mate = "${CN_DESKTOP}" ]]; then
521 chroot ${CN_DESTDIR} systemctl -fq enable sddm
522 cp /usr/share/cnchi/sddm.conf ${CN_DESTDIR}/etc/
523 # chroot ${CN_DESTDIR} sudo pacman -Rdd mate-cosmic-reborn --noconfirm
524 # chroot ${CN_DESTDIR} sudo pacman -Rdd common-cosmic-reborn --noconfirm
525 # chroot ${CN_DESTDIR} sudo pacman -Rdd graphic-cosmic-reborn --noconfirm
526 cp /usr/share/cnchi/flatpak.sh ${CN_DESTDIR}/usr/bin/
527 cp /usr/share/cnchi/pkcon.sh ${CN_DESTDIR}/usr/bin/
528 cp /usr/share/cnchi/pkcon2.sh ${CN_DESTDIR}/usr/bin/
529 cp /usr/share/cnchi/flatpak.desktop ${CN_DESTDIR}/usr/share/applications/
530 cp /usr/share/cnchi/update.desktop ${CN_DESTDIR}/etc/xdg/autostart/
531 cp /usr/share/cnchi/updating.sh ${CN_DESTDIR}/usr/bin/
532 chroot ${CN_DESTDIR} mate-panel --reset --layout default
533 # chroot ${CN_DESTDIR} mate-panel --reset --layout cinnamon
534 # chroot ${CN_DESTDIR} sudo mate-panel --reset --layout cinnamon
535 echo "# ---> Added by Cnchi RebornOS Installer Gnome based for MATE Desktop <---" >> ${CN_DESTDIR}/etc/environment
536 echo "QT_QPA_PLATFORMTHEME=qt5ct" >> ${CN_DESTDIR}/etc/environment
537 echo "# ---> End added by Cnchi RebornOS Installer Gnome based for MATE Desktop <---" >> ${CN_DESTDIR}/etc/environment
538 chroot ${CN_DESTDIR} systemctl enable earlyoom
539 chroot ${CN_DESTDIR} systemctl enable ufw
542 if [[ xfce = "${CN_DESKTOP}" ]]; then
543 chroot ${CN_DESTDIR} systemctl -fq enable sddm
544 cp /usr/share/cnchi/sddm.conf ${CN_DESTDIR}/etc/
545 # chroot ${CN_DESTDIR} sudo pacman -Rdd xfce-cosmic-reborn --noconfirm
546 # chroot ${CN_DESTDIR} sudo pacman -Rdd common-cosmic-reborn --noconfirm
547 # chroot ${CN_DESTDIR} sudo pacman -Rdd graphic-cosmic-reborn --noconfirm
548 cp /usr/share/cnchi/flatpak.sh ${CN_DESTDIR}/usr/bin/
549 cp /usr/share/cnchi/pkcon.sh ${CN_DESTDIR}/usr/bin/
550 cp /usr/share/cnchi/pkcon2.sh ${CN_DESTDIR}/usr/bin/
551 cp /usr/share/cnchi/flatpak.desktop ${CN_DESTDIR}/usr/share/applications/
552 cp /usr/share/cnchi/update.desktop ${CN_DESTDIR}/etc/xdg/autostart/
553 cp /usr/share/cnchi/updating.sh ${CN_DESTDIR}/usr/bin/
554 echo "# ---> Added by Cnchi RebornOS Installer Gnome based for XFCE Desktop <---" >> ${CN_DESTDIR}/etc/environment
555 echo "QT_QPA_PLATFORMTHEME=qt5ct" >> ${CN_DESTDIR}/etc/environment
556 echo "# ---> End added by Cnchi RebornOS Installer Gnome based for XFCE Desktop <---" >> ${CN_DESTDIR}/etc/environment
557 chroot ${CN_DESTDIR} systemctl enable earlyoom
558 chroot ${CN_DESTDIR} systemctl enable ufw
561 if [[ cinnamon = "${CN_DESKTOP}" ]]; then
562 chroot ${CN_DESTDIR} systemctl -fq enable sddm
563 cp /usr/share/cnchi/sddm.conf ${CN_DESTDIR}/etc/
564 # chroot ${CN_DESTDIR} sudo pacman -Rdd cinnamon-cosmic-reborn --noconfirm
565 # chroot ${CN_DESTDIR} sudo pacman -Rdd common-cosmic-reborn --noconfirm
566 # chroot ${CN_DESTDIR} sudo pacman -Rdd graphic-cosmic-reborn --noconfirm
567 cp /usr/share/cnchi/flatpak.sh ${CN_DESTDIR}/usr/bin/
568 cp /usr/share/cnchi/pkcon.sh ${CN_DESTDIR}/usr/bin/
569 cp /usr/share/cnchi/pkcon2.sh ${CN_DESTDIR}/usr/bin/
570 cp /usr/share/cnchi/flatpak.desktop ${CN_DESTDIR}/usr/share/applications/
571 cp /usr/share/cnchi/update.desktop ${CN_DESTDIR}/etc/xdg/autostart/
572 cp /usr/share/cnchi/updating.sh ${CN_DESTDIR}/usr/bin/
573 echo "# ---> Added by Cnchi RebornOS Installer Gnome based for Cinnamon Desktop <---" >> ${CN_DESTDIR}/etc/environment
574 echo "QT_QPA_PLATFORMTHEME=qt5ct" >> ${CN_DESTDIR}/etc/environment
575 echo "# ---> End added by Cnchi RebornOS Installer Gnome based for Cinnamon Desktop <---" >> ${CN_DESTDIR}/etc/environment
576 chroot ${CN_DESTDIR} systemctl enable earlyoom
577 chroot ${CN_DESTDIR} systemctl enable ufw
578 cp /usr/share/cnchi/95_cinnamon.gschema.override ${CN_DESTDIR}/usr/share/glib-2.0/schemas/
579 chroot ${CN_DESTDIR} /usr/bin/glib-compile-schemas /usr/share/glib-2.0/schemas
582 if [[ pantheon = "${CN_DESKTOP}" ]]; then
583 chroot ${CN_DESTDIR} systemctl -fq enable sddm
584 cp /usr/share/cnchi/sddm.conf ${CN_DESTDIR}/etc/
585 # chroot ${CN_DESTDIR} sudo pacman -Rdd common-cosmic-reborn --noconfirm
586 # chroot ${CN_DESTDIR} sudo pacman -Rdd graphic-cosmic-reborn --noconfirm
587 # chroot ${CN_DESTDIR} sudo pacman -Rdd elementary-cosmic-reborn --noconfirm
588 cp /usr/share/cnchi/flatpak.sh ${CN_DESTDIR}/usr/bin/
589 cp /usr/share/cnchi/pkcon.sh ${CN_DESTDIR}/usr/bin/
590 cp /usr/share/cnchi/pkcon2.sh ${CN_DESTDIR}/usr/bin/
591 cp /usr/share/cnchi/flatpak.desktop ${CN_DESTDIR}/usr/share/applications/
592 cp /usr/share/cnchi/update.desktop ${CN_DESTDIR}/etc/xdg/autostart/
593 cp /usr/share/cnchi/updating.sh ${CN_DESTDIR}/usr/bin/
594 echo "# ---> Added by Cnchi RebornOS Installer Gnome based for Pantheon Desktop <---" >> ${CN_DESTDIR}/etc/environment
595 echo "QT_QPA_PLATFORMTHEME=qt5ct" >> ${CN_DESTDIR}/etc/environment
596 echo "# ---> End added by Cnchi RebornOS Installer Gnome based for Pantheon Desktop <---" >> ${CN_DESTDIR}/etc/environment
597 chroot ${CN_DESTDIR} systemctl enable earlyoom
598 chroot ${CN_DESTDIR} systemctl enable ufw
601 if [[ windows = "${CN_DESKTOP}" ]]; then
602 chroot ${CN_DESTDIR} systemctl -fq enable sddm
603 cp /usr/share/cnchi/sddm.conf ${CN_DESTDIR}/etc/
604 # chroot ${CN_DESTDIR} sudo pacman -Rdd cinnamon-cosmic-reborn --noconfirm
605 # chroot ${CN_DESTDIR} sudo pacman -Rdd common-cosmic-reborn --noconfirm
606 # chroot ${CN_DESTDIR} sudo pacman -Rdd graphic-cosmic-reborn --noconfirm
607 cp /usr/share/cnchi/flatpak.sh ${CN_DESTDIR}/usr/bin/
608 cp /usr/share/cnchi/pkcon.sh ${CN_DESTDIR}/usr/bin/
609 cp /usr/share/cnchi/pkcon2.sh ${CN_DESTDIR}/usr/bin/
610 cp /usr/share/cnchi/flatpak.desktop ${CN_DESTDIR}/usr/share/applications/
611 cp /usr/share/cnchi/update.desktop ${CN_DESTDIR}/etc/xdg/autostart/
612 cp /usr/share/cnchi/updating.sh ${CN_DESTDIR}/usr/bin/
613 echo "# ---> Added by Cnchi RebornOS Installer Gnome based for Windows Desktop <---" >> ${CN_DESTDIR}/etc/environment
614 echo "QT_QPA_PLATFORMTHEME=qt5ct" >> ${CN_DESTDIR}/etc/environment
615 echo "# ---> End added by Cnchi RebornOS Installer Gnome based for Windows Desktop <---" >> ${CN_DESTDIR}/etc/environment
616 chroot ${CN_DESTDIR} systemctl enable earlyoom
617 chroot ${CN_DESTDIR} systemctl enable ufw
620 # Copy pacman.conf file over
621 rm ${CN_DESTDIR}/etc/pacman.conf
622 cp /usr/share/cnchi/pacman.conf ${CN_DESTDIR}/etc/
623 cp /etc/pacman.d/reborn-mirrorlist ${CN_DESTDIR}/etc/pacman.d/
625 #Copy blacklist.conf file over
626 cp /etc/modprobe.d/blacklist.conf ${CN_DESTDIR}/etc/modprobe.d/
628 #Copy Plymouth Files over if the Plymouth feature has been selected
629 if [ -f "${CN_DESTDIR}/usr/bin/plymouth" ]; then
630 echo "[STATUS] Plymouth selected. Configuring now..." >${CN_DESTDIR}/var/log/cnchi/plymouth.log
631 echo "[STATUS] Plymouth selected. Configuring now..." >/tmp/cnchi.log
632 cp /usr/share/cnchi/plymouth.sh ${CN_DESTDIR}/usr/bin/
633 cp /usr/share/cnchi/plymouth-reborn.desktop ${CN_DESTDIR}/etc/xdg/autostart/
634 chroot ${CN_DESTDIR} plymouth-set-default-theme -R arch-charge-big
635 echo "[SUCCESS] Plymouth has been installed and configured" >${CN_DESTDIR}/var/log/cnchi/plymouth.log
636 echo "[SUCCESS] Plymouth has been installed and configured" >/tmp/cnchi.log
638 echo "[STATUS] Plymouth not selected" >${CN_DESTDIR}/var/log/cnchi/plymouth.log
639 echo "[STATUS] Plymouth not selected" >/tmp/postinstall.log
642 # Ensure user permissions are set in /home
643 chroot "${CN_DESTDIR}" chown -R "${CN_USER_NAME}:users" "/home/${CN_USER_NAME}"
645 # Remove reborn user if it still exists
646 if [ -d "${CN_DESTDIR}/home/reborn" ]; then
647 chroot ${CN_DESTDIR} sudo rm -rf /home/reborn
650 # Remove rebornos user if it still exists
651 if [ -d "${CN_DESTDIR}/home/rebornos" ]; then
652 chroot ${CN_DESTDIR} sudo rm -rf /home/reborn
655 # Start vbox client services if we are installed in vbox
656 if [[ ${CN_IS_VBOX} = "True" ]] || { [[ $(systemd-detect-virt) ]] && [[ 'oracle' = $(systemd-detect-virt -v) ]]; }; then
657 # TODO: This should be done differently
658 sed -i 's|echo "X|/usr/bin/VBoxClient-all \&\necho "X|g' "${CN_DESTDIR}/etc/lightdm/Xsession"
662 touch /tmp/.postinstall.lock
663 echo "Called installation script with these parameters: [$1] [$2] [$3] [$4] [$5] [$6] [$7]" > /tmp/postinstall.log
669 CN_KEYBOARD_LAYOUT=$6
670 CN_KEYBOARD_VARIANT=$7
672 # Use this to test this script (remember to mount /install manually before testing)
673 #chroot_setup "${CN_DESTDIR}"
675 { postinstall; } >> /tmp/postinstall.log 2>&1
676 rm /tmp/.postinstall.lock