jitty-scripts/flatjerk.sh

71 lines
1.7 KiB
Bash
Raw Permalink Normal View History

#!/bin/bash
flatpakBin=$(/usr/bin/flatpak)
checkApt=$(/usr/bin/apt)
checkXbps=$(/usr/bin/xbps-install)
installFlatpak(){
if [ ! -f ${flatpakBin} ];then
if [ -f ${checkXbps} ];then
sudo xbps-install -S flatpak
elif [ -f ${checkApt} ];then
printf "\nChecking for PPA\n"
if [ ! -f /etc/apt/sources.list.d/alexlarsson-ubuntu-flatpak-xenial.list ];then
printf "\nInstalling PPA\n"
sudo add-apt-repository ppa:alexlarsson/flatpak
sudo apt update
sudo apt install flatpak
else
sudo apt install flatpak
fi
else
printf "\nUnsupported Operating System"
fi
else
printf "\nFlatpak is already installed\n"
fi
}
addFlatpakRepo(){
if [ -f ${flatpakBin} ];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(){
2020-11-10 23:23:40 -07:00
echo -e "\nInstalling Shortwave..\n"
2020-11-10 23:03:25 -07:00
flatpak install flathub shortwave -y
2020-11-10 23:23:40 -07:00
echo -e "\nInstalling Adapta Theme...\n"
flatpak install flathub org.gtk.Gtk3theme.Adapta-Nokto-Eta
2020-11-10 23:23:40 -07:00
echo -e "Installing Bitwarden...\n"
flatpak install flathub bitwarden -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
;;
2020-11-10 23:24:52 -07:00
-r)
addFlatpakRepo
;;
esac