#!/bin/bash -e # Enable xcompmgr on_chroot << EOF raspi-config nonint do_xcompmgr 0 EOF # polkit fixes install -m 644 files/polkit-admin.conf "${ROOTFS_DIR}/etc/polkit-1/localauthority.conf.d/51-admin.conf" # Include custom vendor file for gnome-inital-setup mkdir -p "${ROOTFS_DIR}/usr/share/gnome-initial-setup/" install -m 644 files/vendor.conf "${ROOTFS_DIR}/usr/share/gnome-initial-setup/" # Configure default GDM3 Session to Xorg mkdir -p "${ROOTFS_DIR}/var/lib/gdm" on_chroot << EOF sed -i 's/#WaylandEnable=false/WaylandEnable=false/' /etc/gdm3/daemon.conf touch /var/lib/gdm/run-initial-setup EOF # Set default gnome-extensions mkdir -p "${ROOTFS_DIR}/etc/dconf/db/local.d" mkdir -p "${ROOTFS_DIR}/etc/dconf/profile" install -m 644 files/gnome-extensions "${ROOTFS_DIR}/etc/dconf/db/local.d/00-extensions" on_chroot << EOF # Create the user profile to link user-db:user and system-db:local echo "user-db:user" > /etc/dconf/profile/user echo "system-db:local" >> /etc/dconf/profile/user EOF # Set default Wallpaper mkdir -p "${ROOTFS_DIR}/usr/local/share/backgrounds" install -m 644 files/loveimage.png "${ROOTFS_DIR}/usr/local/share/backgrounds/loveimage.png" install -m 644 files/gnome-background "${ROOTFS_DIR}/etc/dconf/db/local.d/00-background" # Run the dconf update as the first user on_chroot << EOF SUDO_USER="${FIRST_USER_NAME}" dconf update EOF # Pi-Apps (this is a bash script that installs pi-apps when the user runs it, then gets overwritten by the actual pi-apps) install -m 755 files/pi-apps "${ROOTFS_DIR}/usr/bin/pi-apps" install -m 755 files/pi-apps.desktop "${ROOTFS_DIR}/usr/share/applications/pi-apps.desktop" install -m 644 files/pi-apps-logo.png "${ROOTFS_DIR}/usr/share/icons/hicolor/256x256/apps/pi-apps.png" # Remove setup user (only if it's not a system account) on_chroot << EOF #deluser --remove-home --remove-all-files ${FIRST_USER_NAME} if [ "${FIRST_USER_ISSYSTEM}" = "false" ]; then deluser --remove-home --remove-all-files ${FIRST_USER_NAME} fi EOF