linutil/core/tabs/applications-setup/office-suites/libreoffice.sh
JEEVITHA KANNAN K S d4eacaeab3
refact fix: Flatpak (#705)
* Fix flatpak paths

* Refact office suites flatpak

* Merge flatpak_app_exists and command_exists

* Fix binary path bug

* Add apk pgm

---------

Co-authored-by: Chris Titus <contact@christitus.com>
2024-11-01 12:25:11 -05:00

31 lines
931 B
Bash

#!/bin/sh -e
. ../../common-script.sh
installLibreOffice() {
if ! command_exists org.libreoffice.LibreOffice && ! command_exists libreoffice; then
printf "%b\n" "${YELLOW}Installing Libre Office...${RC}"
case "$PACKAGER" in
apt-get|nala)
"$ESCALATION_TOOL" "$PACKAGER" install -y libreoffice-core
;;
zypper|dnf)
checkFlatpak
flatpak install -y flathub org.libreoffice.LibreOffice
;;
pacman)
"$ESCALATION_TOOL" "$PACKAGER" -S --needed --noconfirm libreoffice-fresh
;;
*)
printf "%b\n" "${RED}Unsupported package manager: ""$PACKAGER""${RC}"
exit 1
;;
esac
else
printf "%b\n" "${GREEN}Libre Office is already installed.${RC}"
fi
}
checkEnv
checkEscalationTool
installLibreOffice