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_antergos.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_antergos*; 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 # Configure makepkg so that it doesn't compress packages after building.
342 # Most users are building packages to install them locally so there's no need for compression.
343 sed -i "s|^PKGEXT='.pkg.tar.xz'|PKGEXT='.pkg.tar'|g" "${CN_DESTDIR}/etc/makepkg.conf"
345 # Set lightdm-webkit2-greeter in lightdm.conf. This should have been done here (not in the pkg) all along.
346 if [[ deepin = "${CN_DESKTOP}" ]]; then
347 rm ${CN_DESTDIR}/etc/lightdm/lightdm.conf
348 cp /etc/lightdm/lightdm.conf ${CN_DESTDIR}/etc/lightdm/
349 # chroot ${CN_DESTDIR} sudo pacman -Rdd deepin-cosmic-reborn --noconfirm
350 # chroot ${CN_DESTDIR} sudo pacman -Rdd common-cosmic-reborn --noconfirm
351 # chroot ${CN_DESTDIR} sudo pacman -Rdd graphic-cosmic-reborn --noconfirm
352 # chroot ${CN_DESTDIR} sudo pacman -Rdd qt5ct --noconfirm --> Not installed now
353 cp /usr/share/cnchi/flatpak.sh ${CN_DESTDIR}/usr/bin/
354 cp /usr/share/cnchi/pkcon.sh ${CN_DESTDIR}/usr/bin/
355 cp /usr/share/cnchi/pkcon2.sh ${CN_DESTDIR}/usr/bin/
356 cp /usr/share/cnchi/flatpak.desktop ${CN_DESTDIR}/usr/share/applications/
357 cp /usr/share/cnchi/update.desktop ${CN_DESTDIR}/etc/xdg/autostart/
358 cp /usr/share/cnchi/updating.sh ${CN_DESTDIR}/usr/bin/
359 cp /usr/share/cnchi/deepin-fix.sh ${CN_DESTDIR}/usr/bin/
360 cp /usr/share/cnchi/deepin-fix.service ${CN_DESTDIR}/etc/systemd/system/
361 chroot ${CN_DESTDIR} sudo systemctl enable deepin-fix.service
362 chroot ${CN_DESTDIR} systemctl enable earlyoom
363 chroot ${CN_DESTDIR} systemctl enable ufw
366 if [[ gnome = "${CN_DESKTOP}" ]]; then
367 chroot ${CN_DESTDIR} systemctl -fq enable gdm
368 # chroot ${CN_DESTDIR} sudo pacman -Rdd gnome-cosmic-reborn --noconfirm
369 # chroot ${CN_DESTDIR} sudo pacman -Rdd common-cosmic-reborn --noconfirm
370 # chroot ${CN_DESTDIR} sudo pacman -Rdd graphic-cosmic-reborn --noconfirm
371 cp /usr/share/cnchi/flatpak.sh ${CN_DESTDIR}/usr/bin/
372 cp /usr/share/cnchi/pkcon.sh ${CN_DESTDIR}/usr/bin/
373 cp /usr/share/cnchi/pkcon2.sh ${CN_DESTDIR}/usr/bin/
374 cp /usr/share/cnchi/flatpak.desktop ${CN_DESTDIR}/usr/share/applications/
375 cp /usr/share/cnchi/update.desktop ${CN_DESTDIR}/etc/xdg/autostart/
376 cp /usr/share/cnchi/updating.sh ${CN_DESTDIR}/usr/bin/
377 echo "# ---> Added by Cnchi RebornOS Installer Gnome based for Gnome Desktop <---" >> ${CN_DESTDIR}/etc/environment
378 echo "QT_QPA_PLATFORMTHEME=qt5ct" >> ${CN_DESTDIR}/etc/environment
379 echo "# ---> End added by Cnchi RebornOS Installer Gnome based for Gnome Desktop <---" >> ${CN_DESTDIR}/etc/environment
380 chroot ${CN_DESTDIR} systemctl enable earlyoom
381 chroot ${CN_DESTDIR} systemctl enable ufw
384 if [[ apricity = "${CN_DESKTOP}" ]]; then
385 chroot ${CN_DESTDIR} systemctl -fq enable gdm
386 # chroot ${CN_DESTDIR} sudo pacman -Rdd gnome-cosmic-reborn --noconfirm
387 # chroot ${CN_DESTDIR} sudo pacman -Rdd common-cosmic-reborn --noconfirm
388 # chroot ${CN_DESTDIR} sudo pacman -Rdd graphic-cosmic-reborn --noconfirm
389 cp /usr/share/cnchi/flatpak.sh ${CN_DESTDIR}/usr/bin/
390 cp /usr/share/cnchi/pkcon.sh ${CN_DESTDIR}/usr/bin/
391 cp /usr/share/cnchi/pkcon2.sh ${CN_DESTDIR}/usr/bin/
392 cp /usr/share/cnchi/flatpak.desktop ${CN_DESTDIR}/usr/share/applications/
393 cp /usr/share/cnchi/update.desktop ${CN_DESTDIR}/etc/xdg/autostart/
394 cp /usr/share/cnchi/updating.sh ${CN_DESTDIR}/usr/bin/
395 echo "# ---> Added by Cnchi RebornOS Installer Gnome based for Apricity Desktop <---" >> ${CN_DESTDIR}/etc/environment
396 echo "QT_QPA_PLATFORMTHEME=qt5ct" >> ${CN_DESTDIR}/etc/environment
397 echo "# ---> End added by Cnchi RebornOS Installer Gnome based for Apricity Desktop <---" >> ${CN_DESTDIR}/etc/environment
398 chroot ${CN_DESTDIR} systemctl enable earlyoom
399 chroot ${CN_DESTDIR} systemctl enable ufw
402 if [[ kde = "${CN_DESKTOP}" ]]; then
403 chroot ${CN_DESTDIR} systemctl -fq enable sddm
404 cp /usr/share/cnchi/sddm.conf ${CN_DESTDIR}/etc/
405 # chroot ${CN_DESTDIR} sudo pacman -Rdd kde-cosmic-reborn --noconfirm
406 # chroot ${CN_DESTDIR} sudo pacman -Rdd common-cosmic-reborn --noconfirm
407 # chroot ${CN_DESTDIR} sudo pacman -Rdd graphic-cosmic-reborn --noconfirm
408 cp /usr/share/cnchi/flatpak.sh ${CN_DESTDIR}/usr/bin/
409 cp /usr/share/cnchi/pkcon.sh ${CN_DESTDIR}/usr/bin/
410 cp /usr/share/cnchi/pkcon2.sh ${CN_DESTDIR}/usr/bin/
411 cp /usr/share/cnchi/flatpak.desktop ${CN_DESTDIR}/usr/share/applications/
412 cp /usr/share/cnchi/update.desktop ${CN_DESTDIR}/etc/xdg/autostart/
413 cp /usr/share/cnchi/updating.sh ${CN_DESTDIR}/usr/bin/
414 chroot ${CN_DESTDIR} systemctl enable earlyoom
415 chroot ${CN_DESTDIR} systemctl enable ufw
418 if [[ budgie = "${CN_DESKTOP}" ]]; then
419 chroot ${CN_DESTDIR} systemctl -fq enable lightdm
420 sed -i 's/^webkit_theme\s*=\s*\(.*\)/webkit_theme = lightdm-webkit-theme-aether #\1/g' ${CN_DESTDIR}/etc/lightdm/lightdm-webkit2-greeter.conf
421 sed -i 's/^\(#?greeter\)-session\s*=\s*\(.*\)/greeter-session = lightdm-webkit2-greeter #\1/ #\2g' ${CN_DESTDIR}/etc/lightdm/lightdm.conf
422 # chroot ${CN_DESTDIR} sudo pacman -Rdd budgie-cosmic-reborn --noconfirm
423 # chroot ${CN_DESTDIR} sudo pacman -Rdd common-cosmic-reborn --noconfirm
424 # chroot ${CN_DESTDIR} sudo pacman -Rdd graphic-cosmic-reborn --noconfirm
425 cp /usr/share/cnchi/flatpak.sh ${CN_DESTDIR}/usr/bin/
426 cp /usr/share/cnchi/pkcon.sh ${CN_DESTDIR}/usr/bin/
427 cp /usr/share/cnchi/pkcon2.sh ${CN_DESTDIR}/usr/bin/
428 cp /usr/share/cnchi/flatpak.desktop ${CN_DESTDIR}/usr/share/applications/
429 cp /usr/share/cnchi/update.desktop ${CN_DESTDIR}/etc/xdg/autostart/
430 cp /usr/share/cnchi/updating.sh ${CN_DESTDIR}/usr/bin/
431 echo "# ---> Added by Cnchi RebornOS Installer Gnome based for Budgie Desktop <---" >> ${CN_DESTDIR}/etc/environment
432 echo "QT_QPA_PLATFORMTHEME=qt5ct" >> ${CN_DESTDIR}/etc/environment
433 echo "# ---> End added by Cnchi RebornOS Installer Gnome based for Budgie Desktop <---" >> ${CN_DESTDIR}/etc/environment
434 chroot ${CN_DESTDIR} systemctl enable earlyoom
435 chroot ${CN_DESTDIR} systemctl enable ufw
438 if [[ i3 = "${CN_DESKTOP}" ]]; then
439 chroot ${CN_DESTDIR} systemctl -fq enable sddm
440 cp /usr/share/cnchi/sddm.conf ${CN_DESTDIR}/etc/
441 # chroot ${CN_DESTDIR} sudo pacman -Rdd i3-cosmic-reborn --noconfirm
442 # chroot ${CN_DESTDIR} sudo pacman -Rdd common-cosmic-reborn --noconfirm
443 # chroot ${CN_DESTDIR} sudo pacman -Rdd graphic-cosmic-reborn --noconfirm
444 cp /usr/share/cnchi/flatpak.sh ${CN_DESTDIR}/usr/bin/
445 cp /usr/share/cnchi/pkcon.sh ${CN_DESTDIR}/usr/bin/
446 cp /usr/share/cnchi/pkcon2.sh ${CN_DESTDIR}/usr/bin/
447 cp /usr/share/cnchi/flatpak.desktop ${CN_DESTDIR}/usr/share/applications/
448 cp /usr/share/cnchi/update.desktop ${CN_DESTDIR}/etc/xdg/autostart/
449 cp /usr/share/cnchi/updating.sh ${CN_DESTDIR}/usr/bin/
450 echo "# ---> Added by Cnchi RebornOS Installer Gnome based for i3 Desktop <---" >> ${CN_DESTDIR}/etc/environment
451 echo "QT_QPA_PLATFORMTHEME=qt5ct" >> ${CN_DESTDIR}/etc/environment
452 echo "# ---> End added by Cnchi RebornOS Installer Gnome based for i3 Desktop <---" >> ${CN_DESTDIR}/etc/environment
453 chroot ${CN_DESTDIR} systemctl enable earlyoom
454 chroot ${CN_DESTDIR} systemctl enable ufw
457 if [ -f "${CN_DESTDIR}/usr/bin/enlightenment" ]; then
458 chroot ${CN_DESTDIR} systemctl -fq enable sddm
459 cp /usr/share/cnchi/sddm.conf ${CN_DESTDIR}/etc/
460 # chroot ${CN_DESTDIR} sudo pacman -Rdd enlightenment-cosmic-reborn --noconfirm
461 # chroot ${CN_DESTDIR} sudo pacman -Rdd common-cosmic-reborn --noconfirm
462 # chroot ${CN_DESTDIR} sudo pacman -Rdd graphic-cosmic-reborn --noconfirm
463 cp /usr/share/cnchi/flatpak.sh ${CN_DESTDIR}/usr/bin/
464 cp /usr/share/cnchi/pkcon.sh ${CN_DESTDIR}/usr/bin/
465 cp /usr/share/cnchi/pkcon2.sh ${CN_DESTDIR}/usr/bin/
466 cp /usr/share/cnchi/flatpak.desktop ${CN_DESTDIR}/usr/share/applications/
467 cp /usr/share/cnchi/update.desktop ${CN_DESTDIR}/etc/xdg/autostart/
468 cp /usr/share/cnchi/updating.sh ${CN_DESTDIR}/usr/bin/
469 echo "# ---> Added by Cnchi RebornOS Installer Gnome based for Enlightenment Desktop <---" >> ${CN_DESTDIR}/etc/environment
470 echo "QT_QPA_PLATFORMTHEME=qt5ct" >> ${CN_DESTDIR}/etc/environment
471 echo "# ---> End added by Cnchi RebornOS Installer Gnome based for Enlightenment Desktop <---" >> ${CN_DESTDIR}/etc/environment
472 chroot ${CN_DESTDIR} systemctl enable earlyoom
473 chroot ${CN_DESTDIR} systemctl enable ufw
476 if [[ lxqt = "${CN_DESKTOP}" ]]; then
477 chroot ${CN_DESTDIR} systemctl -fq enable sddm
478 cp /usr/share/cnchi/sddm.conf ${CN_DESTDIR}/etc/
479 # chroot ${CN_DESTDIR} sudo pacman -Rdd lxqt-cosmic-reborn --noconfirm
480 # chroot ${CN_DESTDIR} sudo pacman -Rdd common-cosmic-reborn --noconfirm
481 # chroot ${CN_DESTDIR} sudo pacman -Rdd graphic-cosmic-reborn --noconfirm
482 cp /usr/share/cnchi/flatpak.sh ${CN_DESTDIR}/usr/bin/
483 cp /usr/share/cnchi/pkcon.sh ${CN_DESTDIR}/usr/bin/
484 cp /usr/share/cnchi/pkcon2.sh ${CN_DESTDIR}/usr/bin/
485 cp /usr/share/cnchi/flatpak.desktop ${CN_DESTDIR}/usr/share/applications/
486 cp /usr/share/cnchi/update.desktop ${CN_DESTDIR}/etc/xdg/autostart/
487 cp /usr/share/cnchi/updating.sh ${CN_DESTDIR}/usr/bin/
488 chroot ${CN_DESTDIR} systemctl enable earlyoom
489 chroot ${CN_DESTDIR} systemctl enable ufw
492 if [ -f "${CN_DESTDIR}/usr/bin/lxsession" ]; then
493 rm ${CN_DESTDIR}/etc/lightdm/lightdm-webkit2-greeter.conf
494 cp /usr/share/cnchi/lightdm-webkit2-greeter.conf ${CN_DESTDIR}/etc/lightdm/
495 chmod go=rx ${CN_DESTDIR}/var/lib/lightdm-data
496 chroot ${CN_DESTDIR} systemctl -fq enable lxdm
497 # chroot ${CN_DESTDIR} sudo pacman -Rdd openbox-cosmic-reborn --noconfirm
498 # chroot ${CN_DESTDIR} sudo pacman -Rdd common-cosmic-reborn --noconfirm
499 # chroot ${CN_DESTDIR} sudo pacman -Rdd graphic-cosmic-reborn --noconfirm
500 cp /usr/share/cnchi/flatpak.sh ${CN_DESTDIR}/usr/bin/
501 cp /usr/share/cnchi/pkcon.sh ${CN_DESTDIR}/usr/bin/
502 cp /usr/share/cnchi/pkcon2.sh ${CN_DESTDIR}/usr/bin/
503 cp /usr/share/cnchi/flatpak.desktop ${CN_DESTDIR}/usr/share/applications/
504 cp /usr/share/cnchi/update.desktop ${CN_DESTDIR}/etc/xdg/autostart/
505 cp /usr/share/cnchi/conky-start.desktop ${CN_DESTDIR}/etc/xdg/autostart/
506 cp /usr/share/cnchi/updating.sh ${CN_DESTDIR}/usr/bin/
507 cp /usr/share/cnchi/tint2-start.desktop ${CN_DESTDIR}/etc/xdg/autostart/
508 cp /usr/share/cnchi/obmenu-gen.desktop ${CN_DESTDIR}/etc/xdg/autostart/
509 cp /usr/share/cnchi/openbox-config.sh ${CN_DESTDIR}/usr/bin/
510 chroot ${CN_DESTDIR} obmenu-generator -p -i
511 chroot ${CN_DESTDIR} systemctl enable earlyoom
512 chroot ${CN_DESTDIR} systemctl enable ufw
515 if [[ mate = "${CN_DESKTOP}" ]]; then
516 chroot ${CN_DESTDIR} systemctl -fq enable sddm
517 cp /usr/share/cnchi/sddm.conf ${CN_DESTDIR}/etc/
518 # chroot ${CN_DESTDIR} sudo pacman -Rdd mate-cosmic-reborn --noconfirm
519 # chroot ${CN_DESTDIR} sudo pacman -Rdd common-cosmic-reborn --noconfirm
520 # chroot ${CN_DESTDIR} sudo pacman -Rdd graphic-cosmic-reborn --noconfirm
521 cp /usr/share/cnchi/flatpak.sh ${CN_DESTDIR}/usr/bin/
522 cp /usr/share/cnchi/pkcon.sh ${CN_DESTDIR}/usr/bin/
523 cp /usr/share/cnchi/pkcon2.sh ${CN_DESTDIR}/usr/bin/
524 cp /usr/share/cnchi/flatpak.desktop ${CN_DESTDIR}/usr/share/applications/
525 cp /usr/share/cnchi/update.desktop ${CN_DESTDIR}/etc/xdg/autostart/
526 cp /usr/share/cnchi/updating.sh ${CN_DESTDIR}/usr/bin/
527 chroot ${CN_DESTDIR} mate-panel --reset --layout default
528 # chroot ${CN_DESTDIR} mate-panel --reset --layout cinnamon
529 # chroot ${CN_DESTDIR} sudo mate-panel --reset --layout cinnamon
530 echo "# ---> Added by Cnchi RebornOS Installer Gnome based for MATE Desktop <---" >> ${CN_DESTDIR}/etc/environment
531 echo "QT_QPA_PLATFORMTHEME=qt5ct" >> ${CN_DESTDIR}/etc/environment
532 echo "# ---> End added by Cnchi RebornOS Installer Gnome based for MATE Desktop <---" >> ${CN_DESTDIR}/etc/environment
533 chroot ${CN_DESTDIR} systemctl enable earlyoom
534 chroot ${CN_DESTDIR} systemctl enable ufw
537 if [[ xfce = "${CN_DESKTOP}" ]]; then
538 chroot ${CN_DESTDIR} systemctl -fq enable sddm
539 cp /usr/share/cnchi/sddm.conf ${CN_DESTDIR}/etc/
540 # chroot ${CN_DESTDIR} sudo pacman -Rdd xfce-cosmic-reborn --noconfirm
541 # chroot ${CN_DESTDIR} sudo pacman -Rdd common-cosmic-reborn --noconfirm
542 # chroot ${CN_DESTDIR} sudo pacman -Rdd graphic-cosmic-reborn --noconfirm
543 cp /usr/share/cnchi/flatpak.sh ${CN_DESTDIR}/usr/bin/
544 cp /usr/share/cnchi/pkcon.sh ${CN_DESTDIR}/usr/bin/
545 cp /usr/share/cnchi/pkcon2.sh ${CN_DESTDIR}/usr/bin/
546 cp /usr/share/cnchi/flatpak.desktop ${CN_DESTDIR}/usr/share/applications/
547 cp /usr/share/cnchi/update.desktop ${CN_DESTDIR}/etc/xdg/autostart/
548 cp /usr/share/cnchi/updating.sh ${CN_DESTDIR}/usr/bin/
549 echo "# ---> Added by Cnchi RebornOS Installer Gnome based for XFCE Desktop <---" >> ${CN_DESTDIR}/etc/environment
550 echo "QT_QPA_PLATFORMTHEME=qt5ct" >> ${CN_DESTDIR}/etc/environment
551 echo "# ---> End added by Cnchi RebornOS Installer Gnome based for XFCE Desktop <---" >> ${CN_DESTDIR}/etc/environment
552 chroot ${CN_DESTDIR} systemctl enable earlyoom
553 chroot ${CN_DESTDIR} systemctl enable ufw
556 if [[ cinnamon = "${CN_DESKTOP}" ]]; then
557 chroot ${CN_DESTDIR} systemctl -fq enable sddm
558 cp /usr/share/cnchi/sddm.conf ${CN_DESTDIR}/etc/
559 # chroot ${CN_DESTDIR} sudo pacman -Rdd cinnamon-cosmic-reborn --noconfirm
560 # chroot ${CN_DESTDIR} sudo pacman -Rdd common-cosmic-reborn --noconfirm
561 # chroot ${CN_DESTDIR} sudo pacman -Rdd graphic-cosmic-reborn --noconfirm
562 cp /usr/share/cnchi/flatpak.sh ${CN_DESTDIR}/usr/bin/
563 cp /usr/share/cnchi/pkcon.sh ${CN_DESTDIR}/usr/bin/
564 cp /usr/share/cnchi/pkcon2.sh ${CN_DESTDIR}/usr/bin/
565 cp /usr/share/cnchi/flatpak.desktop ${CN_DESTDIR}/usr/share/applications/
566 cp /usr/share/cnchi/update.desktop ${CN_DESTDIR}/etc/xdg/autostart/
567 cp /usr/share/cnchi/updating.sh ${CN_DESTDIR}/usr/bin/
568 echo "# ---> Added by Cnchi RebornOS Installer Gnome based for Cinnamon Desktop <---" >> ${CN_DESTDIR}/etc/environment
569 echo "QT_QPA_PLATFORMTHEME=qt5ct" >> ${CN_DESTDIR}/etc/environment
570 echo "# ---> End added by Cnchi RebornOS Installer Gnome based for Cinnamon Desktop <---" >> ${CN_DESTDIR}/etc/environment
571 chroot ${CN_DESTDIR} systemctl enable earlyoom
572 chroot ${CN_DESTDIR} systemctl enable ufw
575 if [[ pantheon = "${CN_DESKTOP}" ]]; then
576 chroot ${CN_DESTDIR} systemctl -fq enable sddm
577 cp /usr/share/cnchi/sddm.conf ${CN_DESTDIR}/etc/
578 # chroot ${CN_DESTDIR} sudo pacman -Rdd common-cosmic-reborn --noconfirm
579 # chroot ${CN_DESTDIR} sudo pacman -Rdd graphic-cosmic-reborn --noconfirm
580 # chroot ${CN_DESTDIR} sudo pacman -Rdd elementary-cosmic-reborn --noconfirm
581 cp /usr/share/cnchi/flatpak.sh ${CN_DESTDIR}/usr/bin/
582 cp /usr/share/cnchi/pkcon.sh ${CN_DESTDIR}/usr/bin/
583 cp /usr/share/cnchi/pkcon2.sh ${CN_DESTDIR}/usr/bin/
584 cp /usr/share/cnchi/flatpak.desktop ${CN_DESTDIR}/usr/share/applications/
585 cp /usr/share/cnchi/update.desktop ${CN_DESTDIR}/etc/xdg/autostart/
586 cp /usr/share/cnchi/updating.sh ${CN_DESTDIR}/usr/bin/
587 echo "# ---> Added by Cnchi RebornOS Installer Gnome based for Pantheon Desktop <---" >> ${CN_DESTDIR}/etc/environment
588 echo "QT_QPA_PLATFORMTHEME=qt5ct" >> ${CN_DESTDIR}/etc/environment
589 echo "# ---> End added by Cnchi RebornOS Installer Gnome based for Pantheon Desktop <---" >> ${CN_DESTDIR}/etc/environment
590 chroot ${CN_DESTDIR} systemctl enable earlyoom
591 chroot ${CN_DESTDIR} systemctl enable ufw
594 if [[ windows = "${CN_DESKTOP}" ]]; then
595 chroot ${CN_DESTDIR} systemctl -fq enable sddm
596 cp /usr/share/cnchi/sddm.conf ${CN_DESTDIR}/etc/
597 # chroot ${CN_DESTDIR} sudo pacman -Rdd cinnamon-cosmic-reborn --noconfirm
598 # chroot ${CN_DESTDIR} sudo pacman -Rdd common-cosmic-reborn --noconfirm
599 # chroot ${CN_DESTDIR} sudo pacman -Rdd graphic-cosmic-reborn --noconfirm
600 cp /usr/share/cnchi/flatpak.sh ${CN_DESTDIR}/usr/bin/
601 cp /usr/share/cnchi/pkcon.sh ${CN_DESTDIR}/usr/bin/
602 cp /usr/share/cnchi/pkcon2.sh ${CN_DESTDIR}/usr/bin/
603 cp /usr/share/cnchi/flatpak.desktop ${CN_DESTDIR}/usr/share/applications/
604 cp /usr/share/cnchi/update.desktop ${CN_DESTDIR}/etc/xdg/autostart/
605 cp /usr/share/cnchi/updating.sh ${CN_DESTDIR}/usr/bin/
606 echo "# ---> Added by Cnchi RebornOS Installer Gnome based for Windows Desktop <---" >> ${CN_DESTDIR}/etc/environment
607 echo "QT_QPA_PLATFORMTHEME=qt5ct" >> ${CN_DESTDIR}/etc/environment
608 echo "# ---> End added by Cnchi RebornOS Installer Gnome based for Windows Desktop <---" >> ${CN_DESTDIR}/etc/environment
609 chroot ${CN_DESTDIR} systemctl enable earlyoom
610 chroot ${CN_DESTDIR} systemctl enable ufw
613 # Copy pacman.conf file over
614 rm ${CN_DESTDIR}/etc/pacman.conf
615 cp /usr/share/cnchi/pacman.conf ${CN_DESTDIR}/etc/
616 cp /etc/pacman.d/reborn-mirrorlist ${CN_DESTDIR}/etc/pacman.d/
618 #Copy blacklist.conf file over
619 cp /etc/modprobe.d/blacklist.conf ${CN_DESTDIR}/etc/modprobe.d/
621 #Copy Plymouth Files over if the Plymouth feature has been selected
622 if [ -f "${CN_DESTDIR}/usr/bin/plymouth" ]; then
623 echo "[STATUS] Plymouth selected. Configuring now..." >${CN_DESTDIR}/var/log/cnchi/plymouth.log
624 echo "[STATUS] Plymouth selected. Configuring now..." >/tmp/cnchi.log
625 cp /usr/share/cnchi/plymouth.sh ${CN_DESTDIR}/usr/bin/
626 cp /usr/share/cnchi/plymouth-reborn.desktop ${CN_DESTDIR}/etc/xdg/autostart/
627 chroot ${CN_DESTDIR} plymouth-set-default-theme -R arch-charge-big
628 echo "[SUCCESS] Plymouth has been installed and configured" >${CN_DESTDIR}/var/log/cnchi/plymouth.log
629 echo "[SUCCESS] Plymouth has been installed and configured" >/tmp/cnchi.log
631 echo "[STATUS] Plymouth not selected" >${CN_DESTDIR}/var/log/cnchi/plymouth.log
632 echo "[STATUS] Plymouth not selected" >/tmp/postinstall.log
635 # Ensure user permissions are set in /home
636 chroot "${CN_DESTDIR}" chown -R "${CN_USER_NAME}:users" "/home/${CN_USER_NAME}"
638 # Remove reborn user if it still exists
639 if [ -d "${CN_DESTDIR}/home/reborn" ]; then
640 chroot ${CN_DESTDIR} sudo rm -rf /home/reborn
643 # Remove rebornos user if it still exists
644 if [ -d "${CN_DESTDIR}/home/rebornos" ]; then
645 chroot ${CN_DESTDIR} sudo rm -rf /home/reborn
648 # Start vbox client services if we are installed in vbox
649 if [[ ${CN_IS_VBOX} = "True" ]] || { [[ $(systemd-detect-virt) ]] && [[ 'oracle' = $(systemd-detect-virt -v) ]]; }; then
650 # TODO: This should be done differently
651 sed -i 's|echo "X|/usr/bin/VBoxClient-all \&\necho "X|g' "${CN_DESTDIR}/etc/lightdm/Xsession"
655 touch /tmp/.postinstall.lock
656 echo "Called installation script with these parameters: [$1] [$2] [$3] [$4] [$5] [$6] [$7]" > /tmp/postinstall.log
662 CN_KEYBOARD_LAYOUT=$6
663 CN_KEYBOARD_VARIANT=$7
665 # Use this to test this script (remember to mount /install manually before testing)
666 #chroot_setup "${CN_DESTDIR}"
668 { postinstall; } >> /tmp/postinstall.log 2>&1
669 rm /tmp/.postinstall.lock