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
|
#!/bin/bash
|
||||||
|
|
||||||
flatpakBin=$(which -a flatpak)
|
flatpakBin=$(/usr/bin/flatpak)
|
||||||
checkApt=$(which -a apt)
|
checkApt=$(/usr/bin/apt)
|
||||||
checkXbps=$(which -a xbps)
|
checkXbps=$(/usr/bin/xbps-install)
|
||||||
installFlatpak(){
|
installFlatpak(){
|
||||||
if [ ! ${flatpakBin} ];then
|
if [ ! -f ${flatpakBin} ];then
|
||||||
if [ ${checkXbps} ];then
|
if [ -f ${checkXbps} ];then
|
||||||
sudo xbps-install -S flatpak
|
sudo xbps-install -S flatpak
|
||||||
|
|
||||||
elif [ ${checkApt} ];then
|
elif [ -f ${checkApt} ];then
|
||||||
printf "\nChecking for PPA\n"
|
printf "\nChecking for PPA\n"
|
||||||
if [ ! -f /etc/apt/sources.list.d/alexlarsson-ubuntu-flatpak-xenial.list ];then
|
if [ ! -f /etc/apt/sources.list.d/alexlarsson-ubuntu-flatpak-xenial.list ];then
|
||||||
printf "\nInstalling PPA\n"
|
printf "\nInstalling PPA\n"
|
||||||
@ -28,7 +28,7 @@ installFlatpak(){
|
|||||||
|
|
||||||
addFlatpakRepo(){
|
addFlatpakRepo(){
|
||||||
|
|
||||||
if [ $(which -a flatpak) ];then
|
if [ -f ${flatpakBin} ];then
|
||||||
printf "\nAdding Flathub Repository..\n"
|
printf "\nAdding Flathub Repository..\n"
|
||||||
flatpak remote-add --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo
|
flatpak remote-add --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo
|
||||||
else
|
else
|
||||||
@ -44,6 +44,21 @@ getPackages(){
|
|||||||
flatpak install flathub org.gtk.Gtk3theme.Adapta-Nokto-Eta
|
flatpak install flathub org.gtk.Gtk3theme.Adapta-Nokto-Eta
|
||||||
}
|
}
|
||||||
|
|
||||||
installFlatpak
|
helpFile(){
|
||||||
addFlatpakRepo
|
echo -e "\n\nusage: ${0} [all] [init]\n\n"
|
||||||
getPackages
|
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