2024-09-19 03:34:42 +01:00
|
|
|
#!/bin/sh -e
|
|
|
|
|
|
|
|
. ../common-script.sh
|
|
|
|
|
2024-11-01 17:25:11 +00:00
|
|
|
checkDE() {
|
2024-09-19 03:34:42 +01:00
|
|
|
if [ -n "$XDG_CURRENT_DESKTOP" ]; then
|
|
|
|
case "$XDG_CURRENT_DESKTOP" in
|
|
|
|
*GNOME*)
|
|
|
|
DE="GNOME"
|
|
|
|
;;
|
|
|
|
*KDE*)
|
|
|
|
DE="KDE"
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
fi
|
|
|
|
}
|
|
|
|
|
2024-11-01 17:25:11 +00:00
|
|
|
installExtra() {
|
2024-09-19 03:34:42 +01:00
|
|
|
if [ "$PACKAGER" = "apt-get" ] || [ "$PACKAGER" = "nala" ]; then
|
2024-11-01 17:25:11 +00:00
|
|
|
checkDE
|
2024-09-19 03:34:42 +01:00
|
|
|
# Only used for Ubuntu GNOME. Ubuntu GNOME doesnt allow flathub to be added as a remote to their store.
|
2024-11-01 17:25:11 +00:00
|
|
|
# So in case the user wants to use a GUI software manager they can setup it here
|
2024-09-19 03:34:42 +01:00
|
|
|
if [ "$DE" = "GNOME" ]; then
|
2024-09-22 17:01:10 +01:00
|
|
|
printf "%b" "${YELLOW}Detected GNOME desktop environment. Would you like to install GNOME Software plugin for Flatpak? (y/N): ${RC}"
|
2024-09-19 22:47:08 +01:00
|
|
|
read -r install_gnome
|
2024-09-19 03:34:42 +01:00
|
|
|
if [ "$install_gnome" = "y" ] || [ "$install_gnome" = "Y" ]; then
|
2024-09-19 19:05:36 +01:00
|
|
|
"$ESCALATION_TOOL" "$PACKAGER" install -y gnome-software-plugin-flatpak
|
2024-09-19 03:34:42 +01:00
|
|
|
fi
|
|
|
|
# Useful for Debian KDE spin as well
|
|
|
|
elif [ "$DE" = "KDE" ]; then
|
2024-09-22 17:01:10 +01:00
|
|
|
printf "%b" "${YELLOW}Detected KDE desktop environment. Would you like to install KDE Plasma Discover backend for Flatpak? (y/N): ${RC}"
|
2024-09-19 22:47:08 +01:00
|
|
|
read -r install_kde
|
2024-09-19 03:34:42 +01:00
|
|
|
if [ "$install_kde" = "y" ] || [ "$install_kde" = "Y" ]; then
|
2024-09-19 19:05:36 +01:00
|
|
|
"$ESCALATION_TOOL" "$PACKAGER" install -y plasma-discover-backend-flatpak
|
2024-09-19 03:34:42 +01:00
|
|
|
fi
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
}
|
|
|
|
|
|
|
|
checkEnv
|
|
|
|
checkEscalationTool
|
2024-11-01 17:25:11 +00:00
|
|
|
checkFlatpak
|
|
|
|
installExtra
|