#! /bin/sh set -eu case ${PASS:-} in minimal.standard.live) ;; *) exit 0 ;; esac cat < /etc/initramfs-tools/conf.d/casperize.conf export CASPER_GENERATE_UUID=1 EOF cat < /etc/initramfs-tools/conf.d/default-layer.conf LAYERFS_PATH=${PASS}.squashfs EOF # change settings to have an 'installer only' session by default printf "[org.gnome.desktop.a11y]\nalways-show-universal-access-status=true\n" \ >> /usr/share/glib-2.0/schemas/casper.gschema.override # we can't unload the dock because the shell would enter the overview on login; # https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1788 printf "[org.gnome.shell.extensions.dash-to-dock:ubuntu]\ndock-fixed=false\nintellihide=false\n" \ >> /root/usr/share/glib-2.0/schemas/casper.gschema.override printf "[org.gnome.shell]\ndisabled-extensions=['ding@rastersoft.com']\n" \ >> /root/usr/share/glib-2.0/schemas/casper.gschema.override glib-compile-schemas /usr/share/glib-2.0/schemas/ # start the installer on session start, restore normal session on close cat > /usr/lib/systemd/user/ubuntu-desktop-installer.service << EOF [Unit] Description=Ubuntu Desktop Installer PartOf=graphical-session.target After=graphical-session.target # Never run in GDM Conflicts=gnome-session@gnome-login.target [Service] Type=oneshot ExecStart=/snap/bin/ubuntu-desktop-installer --try-or-install ExecStopPost=sh -c "gsettings set org.gnome.shell.extensions.dash-to-dock dock-fixed true; gsettings set org.gnome.shell.extensions.dash-to-dock intellihide true; gnome-extensions enable ding@rastersoft.com" Restart=no EOF mkdir /etc/systemd/user/graphical-session.target.wants/ ln -s /usr/lib/systemd/user/ubuntu-desktop-installer.service \ /etc/systemd/user/graphical-session.target.wants/