2018-04-09 08:30:58 -07:00
|
|
|
#!/bin/bash
|
|
|
|
|
2019-01-14 22:35:41 -07:00
|
|
|
flatpakBin=$(/usr/bin/flatpak)
|
|
|
|
checkApt=$(/usr/bin/apt)
|
|
|
|
checkXbps=$(/usr/bin/xbps-install)
|
2018-04-09 08:30:58 -07:00
|
|
|
installFlatpak(){
|
2019-01-14 22:35:41 -07:00
|
|
|
if [ ! -f ${flatpakBin} ];then
|
|
|
|
if [ -f ${checkXbps} ];then
|
2018-04-09 08:30:58 -07:00
|
|
|
sudo xbps-install -S flatpak
|
|
|
|
|
2019-01-14 22:35:41 -07:00
|
|
|
elif [ -f ${checkApt} ];then
|
2018-04-09 08:30:58 -07:00
|
|
|
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(){
|
|
|
|
|
2019-01-14 22:35:41 -07:00
|
|
|
if [ -f ${flatpakBin} ];then
|
2018-04-09 08:30:58 -07:00
|
|
|
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:03:25 -07:00
|
|
|
printf "\nInstalling Shortwave..\n"
|
|
|
|
flatpak install flathub shortwave -y
|
2018-04-09 08:30:58 -07:00
|
|
|
|
|
|
|
printf "\nInstalling Adapta Theme...\n"
|
|
|
|
flatpak install flathub org.gtk.Gtk3theme.Adapta-Nokto-Eta
|
|
|
|
}
|
|
|
|
|
2019-01-14 22:35:41 -07:00
|
|
|
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
|
|
|
|
;;
|
|
|
|
esac
|