From 403910266d8c37f948f63830721ee3b9ec9b79f6e895b430d214d5177b3f24b3 Mon Sep 17 00:00:00 2001 From: Richard Brown Date: Thu, 23 May 2024 16:06:24 +0000 Subject: [PATCH] - Introduce aeon-mig-firstboot to help tuneup home directories after migration OBS-URL: https://build.opensuse.org/package/show/devel:microos:aeon/gnome-branding-Aeon?expand=0&rev=18 --- aeon-mig-firstboot | 55 +++++++++++++++++++++++++++++++++++++ gnome-branding-Aeon.changes | 6 ++++ gnome-branding-Aeon.spec | 4 +++ 3 files changed, 65 insertions(+) create mode 100644 aeon-mig-firstboot diff --git a/aeon-mig-firstboot b/aeon-mig-firstboot new file mode 100644 index 0000000..3f0c744 --- /dev/null +++ b/aeon-mig-firstboot @@ -0,0 +1,55 @@ +#!/bin/bash + +firstMSG() { + #Insert Welcome message here + zenity --info --icon=distributor-logo-Aeon-symbolic --no-wrap --title 'Welcome to openSUSE Aeon' \ + --text 'Almost done, there is one last step\n\nWe need perform some checks to make\nsure your migration has gone smoothly\n\nPlease click OK to Continue' \ + --width 300 --height 300 +} + +show_progress() { + ( + sleep 1 + echo "# Waiting for Internet connection" + until /usr/bin/curl -s --max-time 5 https://flathub.org > /dev/null; do sleep 1; done + while /usr/bin/pgrep -f '/usr/bin/flatpak|/usr/sbin/transactional-update|/usr/bin/pkexec' >/dev/null; do + echo "# Tuning Installation" + sleep 1 + done + )| zenity --progress --title="Final Setup" --width=300 --pulsate --auto-close --no-cancel +} + +installFlatpakRepo(){ + until /usr/bin/curl -s --max-time 5 https://flathub.org > /dev/null; do sleep 1; done + /usr/bin/flatpak remote-add --user --if-not-exists flathub /usr/share/aeon/flathub.flatpakrepo + if [ "$?" != 0 ] ; then + zenity --error \ + --text="Adding Flathub Repo Failed" + exit 1 + fi +} + +install_locale() { + pkexec sh -c "/usr/sbin/transactional-update -n run zypper -n aloc ${LANG} && /usr/sbin/transactional-update -n apply" + if [ "$?" != 0 ] ; then + zenity --error \ + --text="Installing Locales Failed" + exit 1 + fi +} + +lastMSG() { + #Insert Welcome message here + zenity --info --icon=distributor-logo-Aeon-symbolic --no-wrap --title 'Welcome to openSUSE Aeon' \ + --text 'Congratulations!\n\nYour system is ready to be used\n\nWe hope you enjoy using openSUSE Aeon' \ + --width 300 --height 300 + rm ~/.config/autostart/aeon-mig-firstboot.desktop +} + +firstMSG +installFlatpakRepo & +if [[ ! "${LANG}" =~ ^en_ ]]; then + install_locale & +fi +show_progress +lastMSG \ No newline at end of file diff --git a/gnome-branding-Aeon.changes b/gnome-branding-Aeon.changes index 27de6fb..58eee0f 100644 --- a/gnome-branding-Aeon.changes +++ b/gnome-branding-Aeon.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Thu May 23 16:05:53 UTC 2024 - Richard Brown + +- Introduce aeon-mig-firstboot to help tuneup home directories + after migration + ------------------------------------------------------------------- Thu May 23 15:00:50 UTC 2024 - Richard Brown diff --git a/gnome-branding-Aeon.spec b/gnome-branding-Aeon.spec index 9e8d252..b6d902a 100644 --- a/gnome-branding-Aeon.spec +++ b/gnome-branding-Aeon.spec @@ -34,6 +34,7 @@ Source8: distrobox-upgrade-all.timer Source9: 50-aeon Source10: wallpaper-branding-Aeon.xml Source11: 49-aeon.rules +Source12: aeon-mig-firstboot BuildArch: noarch BuildRequires: flatpak BuildRequires: gio-branding-openSUSE @@ -71,6 +72,7 @@ cp -a %{SOURCE8} distrobox-upgrade-all.timer cp -a %{SOURCE9} 50-aeon cp -a %{SOURCE10} wallpaper-branding-Aeon.xml cp -a %{SOURCE11} 49-aeon.rules +cp -a %{SOURCE12} aeon-mig-firstboot %build @@ -83,6 +85,7 @@ install -d %{buildroot}%{_sysconfdir}/skel/.config/autostart install -m0644 aeon-firstboot.desktop %{buildroot}%{_sysconfdir}/skel/.config/autostart/aeon-firstboot.desktop install -d %{buildroot}%{_bindir} install -m0755 aeon-firstboot %{buildroot}%{_bindir}/aeon-firstboot +install -m0755 aeon-mig-firstboot %{buildroot}%{_bindir}/aeon-mig-firstboot install -d %{buildroot}%{_prefix}%{_sysconfdir}/transactional-update.conf.d install -m644 50-desktop.conf %{buildroot}%{_prefix}%{_sysconfdir}/transactional-update.conf.d/50-desktop.conf install -d %{buildroot}%{_datadir}/wallpapers @@ -120,6 +123,7 @@ install -m0444 49-aeon.rules %{buildroot}%{_datadir}/polkit-1/rules.d/49-aeon.ru %dir %{_sysconfdir}/skel/.config/autostart %config(noreplace) %{_sysconfdir}/skel/.config/autostart/aeon-firstboot.desktop %{_bindir}/aeon-firstboot +%{_bindir}/aeon-mig-firstboot %dir %{_prefix}%{_sysconfdir}/transactional-update.conf.d %{_prefix}%{_sysconfdir}/transactional-update.conf.d/50-desktop.conf %dir %{_datadir}/wallpapers