#!/bin/bash installFlatpak(){ if ! command -v flatpak >/dev/null 2>&1;then if command -v xbps-install >/dev/null 2>&1;then sudo xbps-install -S flatpak elif command -v pacman >/dev/null 2>&1;then sudo pacman -S --needed flatpak elif command -v apt >/dev/null 2>&1;then sudo apt install flatpak else printf "\nUnsupported Operating System" fi else printf "\nFlatpak is already installed\n" fi } addFlatpakRepo(){ if command -v flatpak >/dev/null 2>&1;then printf "\nAdding Flathub Repository..\n" flatpak remote-add --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo else echo "Flatpak is not installed" fi } getPackages(){ echo -e "\nInstalling Shortwave..\n" flatpak install flathub de.haeckerfelix.Shortwave -y echo -e "\nInstalling Adapta Theme...\n" flatpak install flathub org.gtk.Gtk3theme.Adapta-Nokto-Eta echo -e "Installing Bitwarden...\n" flatpak install flathub com.bitwarden.desktop -y } helpFile(){ echo -e "\n\nusage: ${0} [all] [init]\n\n" echo -e "init only run initial flatpak setup\n" echo -e "\nall Init setup and packages for jitty\n\n" } case ${1} in init|-i) installFlatpak addFlatpakRepo ;; all|-a) installFlatpak addFlatpakRepo getPackages ;; -r) addFlatpakRepo ;; *) helpFile ;; esac