2023-10-27 05:28:16 +02:00
|
|
|
#!/bin/sh
|
|
|
|
|
|
|
|
dbusRef=$(kdialog --title "openSUSE Kalpa Desktop Firstboot" --geometry 600x400 --progressbar "openSUSE Kalpa Desktop Firstboot" 6)
|
|
|
|
|
|
|
|
run_task() {
|
|
|
|
local step="$1"
|
|
|
|
local label="$2"
|
|
|
|
shift 2
|
|
|
|
|
2024-04-01 23:21:35 +02:00
|
|
|
qdbus6 $dbusRef setLabelText "$label"
|
2023-10-27 05:28:16 +02:00
|
|
|
|
2023-12-27 19:51:59 +01:00
|
|
|
if eval "$@"; then
|
2024-04-01 23:21:35 +02:00
|
|
|
qdbus6 $dbusRef Set "" value "$step"
|
2023-10-27 05:28:16 +02:00
|
|
|
else
|
|
|
|
kdialog --error "Operation Failed: $label"
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
}
|
|
|
|
|
|
|
|
run_task 1 "Waiting for Internet connection" 'until /usr/bin/ping -q -c 1 flathub.org; do sleep 1; done'
|
2023-12-27 18:54:37 +01:00
|
|
|
run_task 2 "Adding Flathub Repository" /usr/bin/flatpak remote-add --user --if-not-exists flathub /usr/share/kalpa/flathub.flatpakrepo
|
2023-10-27 05:28:16 +02:00
|
|
|
run_task 3 "Installing KCalc" /usr/bin/flatpak install --user --noninteractive flathub org.kde.kcalc
|
|
|
|
run_task 4 "Installing Ark" /usr/bin/flatpak install --user --noninteractive flathub org.kde.ark
|
|
|
|
|
2023-12-27 18:54:37 +01:00
|
|
|
run_task 5 "Cleaning up" rm -f ~/.config/autostart/kalpa-firstboot.desktop
|
2023-10-27 05:28:16 +02:00
|
|
|
|
2024-04-01 23:21:35 +02:00
|
|
|
qdbus6 $dbusRef close
|