Update mod-firstboot

This commit is contained in:
Denys Madureira 2024-03-17 21:17:45 +01:00
parent b886d6aa08
commit a6547e7672

View File

@ -1,56 +1,56 @@
#!/bin/sh #!/bin/sh
dbusRef=`kdialog --title "MicroOS Desktop Firstboot" --geometry 600x400 --progressbar "MicroOS Desktop Firstboot" 7` dbusRef=`kdialog --title "MicroOS Desktop Firstboot" --geometry 600x400 --progressbar "MicroOS Desktop Firstboot" 7`
qdbus-qt5 $dbusRef setLabelText "Waiting for Internet connection" qdbus6 $dbusRef setLabelText "Waiting for Internet connection"
until /usr/bin/ping -q -c 1 flathub.org; do sleep 1; done until /usr/bin/ping -q -c 1 flathub.org; do sleep 1; done
qdbus-qt5 $dbusRef Set "" value 1 qdbus6 $dbusRef Set "" value 1
qdbus-qt5 $dbusRef setLabelText "Adding Flathub Repository" qdbus6 $dbusRef setLabelText "Adding Flathub Repository"
/usr/bin/flatpak remote-add --user --if-not-exists flathub /usr/share/microos-desktop/flathub.flatpakrepo /usr/bin/flatpak remote-add --user --if-not-exists flathub /usr/share/microos-desktop/flathub.flatpakrepo
if [ "$?" != 0 ] ; then if [ "$?" != 0 ] ; then
kdialog --error \ kdialog --error \
"Adding Flathub Repo Failed" "Adding Flathub Repo Failed"
exit 1 exit 1
fi fi
qdbus-qt5 $dbusRef Set "" value 2 qdbus6 $dbusRef Set "" value 2
qdbus-qt5 $dbusRef setLabelText "Installing Firefox" qdbus6 $dbusRef setLabelText "Installing Firefox"
/usr/bin/flatpak install --user --noninteractive flathub org.mozilla.firefox /usr/bin/flatpak install --user --noninteractive flathub org.mozilla.firefox
if [ "$?" != 0 ] ; then if [ "$?" != 0 ] ; then
kdialog --error \ kdialog --error \
"Installing Firefox Failed" "Installing Firefox Failed"
exit 1 exit 1
fi fi
qdbus-qt5 $dbusRef Set "" value 3 qdbus6 $dbusRef Set "" value 3
qdbus-qt5 $dbusRef setLabelText "Installing Calculator" qdbus6 $dbusRef setLabelText "Installing Calculator"
/usr/bin/flatpak install --user --noninteractive flathub org.kde.kcalc /usr/bin/flatpak install --user --noninteractive flathub org.kde.kcalc
if [ "$?" != 0 ] ; then if [ "$?" != 0 ] ; then
kdialog --error \ kdialog --error \
"Installing Calculator Failed" "Installing Calculator Failed"
exit 1 exit 1
fi fi
qdbus-qt5 $dbusRef Set "" value 4 qdbus6 $dbusRef Set "" value 4
qdbus-qt5 $dbusRef setLabelText "Installing Ark" qdbus6 $dbusRef setLabelText "Installing Ark"
/usr/bin/flatpak install --user --noninteractive flathub org.kde.ark /usr/bin/flatpak install --user --noninteractive flathub org.kde.ark
if [ "$?" != 0 ] ; then if [ "$?" != 0 ] ; then
kdialog --error \ kdialog --error \
"Installing Ark Failed" "Installing Ark Failed"
exit 1 exit 1
fi fi
qdbus-qt5 $dbusRef Set "" value 5 qdbus6 $dbusRef Set "" value 5
qdbus-qt5 $dbusRef setLabelText "Setting Default Browser" qdbus6 $dbusRef setLabelText "Setting Default Browser"
kwriteconfig5 --file ~/.config/kdeglobals --group General --key BrowserApplication org.mozilla.firefox.desktop kwriteconfig6 --file ~/.config/kdeglobals --group General --key BrowserApplication org.mozilla.firefox.desktop
qdbus-qt5 $dbusRef Set "" value 6 qdbus6 $dbusRef Set "" value 6
qdbus-qt5 $dbusRef setLabelText "Cleaning up" qdbus6 $dbusRef setLabelText "Cleaning up"
rm ~/.config/autostart/mod-firstboot.desktop rm ~/.config/autostart/mod-firstboot.desktop
qdbus-qt5 $dbusRef Set "" value 7 qdbus6 $dbusRef Set "" value 7
if [ "$?" != 0 ] ; then if [ "$?" != 0 ] ; then
kdialog --error \ kdialog --error \
"Firstboot Configuration Error" "Firstboot Configuration Error"
fi fi
kwriteconfig5 --file ~/.config/kdeglobals --group General --key BrowserApplication org.mozilla.firefox.desktop kwriteconfig6 --file ~/.config/kdeglobals --group General --key BrowserApplication org.mozilla.firefox.desktop
qdbus-qt5 $dbusRef close qdbus6 $dbusRef close