flatjerk.sh: fix file checking
Former-commit-id: 5a762fffd15206b689409e2404199d805858208f Former-commit-id: 76d72e8c469ce8282088ff4cc9d95051c52b0b19
This commit is contained in:
parent
9c7e261a0c
commit
a23c530feb
35
flatjerk.sh
35
flatjerk.sh
@ -1,14 +1,14 @@
|
||||
#!/bin/bash
|
||||
|
||||
flatpakBin=$(which -a flatpak)
|
||||
checkApt=$(which -a apt)
|
||||
checkXbps=$(which -a xbps)
|
||||
flatpakBin=$(/usr/bin/flatpak)
|
||||
checkApt=$(/usr/bin/apt)
|
||||
checkXbps=$(/usr/bin/xbps-install)
|
||||
installFlatpak(){
|
||||
if [ ! ${flatpakBin} ];then
|
||||
if [ ${checkXbps} ];then
|
||||
if [ ! -f ${flatpakBin} ];then
|
||||
if [ -f ${checkXbps} ];then
|
||||
sudo xbps-install -S flatpak
|
||||
|
||||
elif [ ${checkApt} ];then
|
||||
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"
|
||||
@ -28,7 +28,7 @@ installFlatpak(){
|
||||
|
||||
addFlatpakRepo(){
|
||||
|
||||
if [ $(which -a flatpak) ];then
|
||||
if [ -f ${flatpakBin} ];then
|
||||
printf "\nAdding Flathub Repository..\n"
|
||||
flatpak remote-add --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo
|
||||
else
|
||||
@ -44,6 +44,21 @@ getPackages(){
|
||||
flatpak install flathub org.gtk.Gtk3theme.Adapta-Nokto-Eta
|
||||
}
|
||||
|
||||
installFlatpak
|
||||
addFlatpakRepo
|
||||
getPackages
|
||||
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
|
Loading…
x
Reference in New Issue
Block a user