flatjerk.sh: fix flatpak/apt/xbps detection and app IDs, add help fallback
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
+13
-17
@@ -1,23 +1,15 @@
|
||||
#!/bin/bash
|
||||
|
||||
flatpakBin=$(/usr/bin/flatpak)
|
||||
checkApt=$(/usr/bin/apt)
|
||||
checkXbps=$(/usr/bin/xbps-install)
|
||||
installFlatpak(){
|
||||
if [ ! -f ${flatpakBin} ];then
|
||||
if [ -f ${checkXbps} ];then
|
||||
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 [ -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
|
||||
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
|
||||
sudo apt install flatpak
|
||||
fi
|
||||
else
|
||||
printf "\nUnsupported Operating System"
|
||||
fi
|
||||
@@ -28,7 +20,7 @@ installFlatpak(){
|
||||
|
||||
addFlatpakRepo(){
|
||||
|
||||
if [ -f ${flatpakBin} ];then
|
||||
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
|
||||
@@ -38,13 +30,13 @@ addFlatpakRepo(){
|
||||
|
||||
getPackages(){
|
||||
echo -e "\nInstalling Shortwave..\n"
|
||||
flatpak install flathub shortwave -y
|
||||
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 bitwarden -y
|
||||
flatpak install flathub com.bitwarden.desktop -y
|
||||
}
|
||||
|
||||
helpFile(){
|
||||
@@ -68,4 +60,8 @@ case ${1} in
|
||||
-r)
|
||||
addFlatpakRepo
|
||||
;;
|
||||
|
||||
*)
|
||||
helpFile
|
||||
;;
|
||||
esac
|
||||
Reference in New Issue
Block a user