Skip to content

Commit

Permalink
added office suite setup script
Browse files Browse the repository at this point in the history
  • Loading branch information
guruswarupa committed Sep 20, 2024
1 parent 77f8085 commit 17c944a
Show file tree
Hide file tree
Showing 2 changed files with 233 additions and 0 deletions.
228 changes: 228 additions & 0 deletions core/tabs/applications-setup/office-suite-setup.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,228 @@
#!/bin/sh -e

. ../common-script.sh

install_onlyoffice() {
printf "%b\n" "${YELLOW}Installing Only Office..${RC}."
if ! command_exists onlyoffice-desktopeditors; then
case "$PACKAGER" in
apt-get|nala)
wget https://download.onlyoffice.com/install/desktop/editors/linux/onlyoffice-desktopeditors_amd64.deb
"$ESCALATION_TOOL" dpkg -i onlyoffice-desktopeditors_amd64.deb
;;
zypper)
. ./setup-flatpak.sh
flatpak install -y flathub org.onlyoffice.desktopeditors
;;
pacman)
"$AUR_HELPER" -S --noconfirm onlyoffice
;;
dnf)
. ./setup-flatpak.sh
flatpak install -y flathub org.onlyoffice.desktopeditors
;;
*)
printf "%b\n" "${RED}The script does not support your Distro. Install manually..${RC}"
;;
esac
else
printf "%b\n" "${GREEN}Only Office is already installed.${RC}"
fi
}

install_libreoffice() {
printf "%b\n" "${YELLOW}Installing Libre Office...${RC}"
if ! command_exists libreoffice; then
case "$PACKAGER" in
apt-get|nala)
"$ESCALATION_TOOL" "$PACKAGER" install -y libreoffice-core
;;
zypper|dnf)
. ./setup-flatpak.sh
flatpak install -y flathub org.libreoffice.LibreOffice
;;
pacman)
"$ESCALATION_TOOL" "$PACKAGER" -S --noconfirm libreoffice-fresh
;;
*)
printf "%b\n" "${RED}Unsupported package manager. Please install Thorium manually.${RC}"
exit 1
;;
esac
else
printf "%b\n" "${GREEN}Libre Office is already installed.${RC}"
fi
}

install_wpsoffice() {
printf "%b\n" "${YELLOW}Installing WPS Office...${RC}"
if ! command_exists com.wps.Office; then
case "$PACKAGER" in
apt-get)
. ./setup-flatpak.sh
flatpak install flathub com.wps.Office
;;
zypper)
. ./setup-flatpak.sh
flatpak install flathub com.wps.Office
;;
pacman)
"$AUR_HELPER" -S --noconfirm wps-office
;;
dnf)
. ./setup-flatpak.sh
flatpak install flathub com.wps.Office
;;
*)
printf "%b\n" "${RED}The script does not support your Distro. Install manually..${RC}"
;;
esac
else
printf "%b\n" "${GREEN}WPS Office is already installed.${RC}"
fi
}

# needs to be updated every year for latest version
install_freeoffice() {
printf "%b\n" "${YELLOW}Installing Free Office...${RC}"
case "$PACKAGER" in
apt-get|nala)
wget https://www.softmaker.net/down/softmaker-freeoffice-2024_1218-01_amd64.deb
"$ESCALATION_TOOL" dpkg -i softmaker-freeoffice-2024_1218-01_amd64.deb
;;
zypper)
"$ESCALATION_TOOL" "$PACKAGER" addrepo -f https://shop.softmaker.com/repo/rpm SoftMaker
"$ESCALATION_TOOL" "$PACKAGER" --gpg-auto-import-keys ref
"$ESCALATION_TOOL" "$PACKAGER" --non-interactive install softmaker-freeoffice-2024
;;
pacman)
"$AUR_HELPER" -S --noconfirm freeoffice
;;
dnf)
"$ESCALATION_TOOL" wget -qO /etc/yum.repos.d/softmaker.repo https://shop.softmaker.com/repo/softmaker.repo
"$ESCALATION_TOOL" "$PACKAGER" update
"$ESCALATION_TOOL" "$PACKAGER" install softmaker-freeoffice-2024
;;
*)
printf "%b\n" "${RED}The script does not support your Distro. Install manually..${RC}"
;;
esac
}

install_evince() {
printf "%b\n" "${YELLOW}Installing Evince...${RC}"
if ! command_exists evince; then
case "$PACKAGER" in
apt-get|nala)
"$ESCALATION_TOOL" "$PACKAGER" install -y evince
;;
zypper)
"$ESCALATION_TOOL" "$PACKAGER" --non-interactive install evince
;;
pacman)
"$ESCALATION_TOOL" "$PACKAGER" -S --noconfirm evince
;;
dnf)
"$ESCALATION_TOOL" "$PACKAGER" install evince
;;
*)
printf "%b\n" "${RED}The script does not support your Distro. Install manually..${RC}"
;;
esac
else
printf "%b\n" "${GREEN}Evince is already installed.${RC}"
fi
}

install_okular(){
printf "%b\n" "${YELLOW}Installing Evince...${RC}"
if ! command_exists okular; then
case "$PACKAGER" in
apt-get|nala)
"$ESCALATION_TOOL" "$PACKAGER" install -y okular
;;
zypper)
"$ESCALATION_TOOL" "$PACKAGER" --non-interactive install okular
;;
pacman)
"$ESCALATION_TOOL" "$PACKAGER" -S --noconfirm okular
;;
dnf)
"$ESCALATION_TOOL" "$PACKAGER" install okular
;;
*)
printf "%b\n" "${RED}The script does not support your Distro. Install manually..${RC}"
;;
esac
else
printf "%b\n" "${GREEN}Okular is already installed.${RC}"
fi
}

install_pdfstudioviewer(){
printf "%b\n" "${YELLOW}Installing PDF Studio Viewer...${RC}"
if ! command_exists pdfstudioviewer2024/pdfstudioviewer2024 ; then
wget https://download.qoppa.com/pdfstudioviewer/PDFStudioViewer_linux64.sh
"$ESCALATION_TOOL" chmod +x PDFStudioViewer_linux64.sh
if sh PDFStudioViewer_linux64.sh; then
printf "%b\n" "${GREEN}PDF Studio Viewer installed successfully!${RC}"
else
printf "%b\n" "${RED}Installation failed! Please check the logs for more details.${RC}"
fi
rm PDFStudioViewer_linux64.sh
else
printf "%b\n" "${GREEN}PDF Studio Viewer is already installed.${RC}"
fi
}

install_pdfstudio(){
printf "%b\n" "${YELLOW}Installing PDF Studio Viewer...${RC}"
if ! command_exists pdfstudio2024/pdfstudio2024 ; then
wget https://download.qoppa.com/pdfstudio/PDFStudio_linux64.sh
"$ESCALATION_TOOL" chmod +x PDFStudio_linux64.sh
sh PDFStudio_linux64.sh
rm PDFStudio_linux64.sh
else
printf "%b\n" "${GREEN}PDF Studio is already installed.${RC}"
fi
}


officeSuiteSetup() {
clear
printf "%b\n" "Office Suite Setup Script"
printf "%b\n" "----------------------------"
printf "%b\n" "Select the suite you want to install:"
printf "%b\n" "1. OnlyOffice"
printf "%b\n" "2. LibreOffice"
printf "%b\n" "3. WPS Office"
printf "%b\n" "4. Free Office"
printf "%b\n" "Select the PDF Suite you want to install:"
printf "%b\n" "----------------------------"
printf "%b\n" "5. Evince"
printf "%b\n" "6. Okular"
printf "%b\n" "7. PDF Studio Viewer"
printf "%b\n" "8. PDF Studio (Paid Software)"
printf "%b\n" "----------------------------"
printf "%b\n" "Enter your choices (e.g., 1 3 5): "
read -r choice
for ch in $choice; do
case $ch in
1) install_onlyoffice ;;
2) install_libreoffice ;;
3) install_wpsoffice ;;
4) install_freeoffice ;;
5) install_evince ;;
6) install_okular ;;
7) install_pdfstudioviewer ;;
8) install_pdfstudio ;;
*) printf "%b\n" "${RED}Invalid option: $ch ${RC}" ;;
esac
done
printf "%b\n" "${GREEN}Installation complete!${RC}"
}

checkEnv
checkEscalationTool
checkAURHelper
officeSuiteSetup
5 changes: 5 additions & 0 deletions core/tabs/applications-setup/tab_data.toml
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,11 @@ name = "Flatpak / Flathub"
description = "Flatpak is a universal application sandbox for Linux that uses isolated packages from Flathub to prevent conflicts and system alterations, while alleviating dependency concerns.\nThis command installs Flatpak and adds the Flathub repository"
script = "setup-flatpak.sh"

[[data]]
name = "Office Suite Setup"
description = "An office suite installer is a software package that installs productivity tools such as word processing, spreadsheets, presentations, and pdf viewers for business and personal use."
script = "office-suite-setup.sh"

[[data]]
name = "Kitty"
description = "kitty is a free and open-source GPU-accelerated terminal emulator for Linux, macOS, and some BSD distributions, focused on performance and features.\nkitty is written in a mix of C and Python programming languages.\n This command installs and configures kitty."
Expand Down

0 comments on commit 17c944a

Please sign in to comment.