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:
2026-10-29 14:59:00 -04:00
co-authored by Claude Opus 5.5
parent 6bd739c793
commit 7fafe84620
+13 -17
View File
@@ -1,23 +1,15 @@
#!/bin/bash #!/bin/bash
flatpakBin=$(/usr/bin/flatpak)
checkApt=$(/usr/bin/apt)
checkXbps=$(/usr/bin/xbps-install)
installFlatpak(){ installFlatpak(){
if [ ! -f ${flatpakBin} ];then if ! command -v flatpak >/dev/null 2>&1;then
if [ -f ${checkXbps} ];then if command -v xbps-install >/dev/null 2>&1;then
sudo xbps-install -S flatpak sudo xbps-install -S flatpak
elif [ -f ${checkApt} ];then elif command -v pacman >/dev/null 2>&1;then
printf "\nChecking for PPA\n" sudo pacman -S --needed flatpak
if [ ! -f /etc/apt/sources.list.d/alexlarsson-ubuntu-flatpak-xenial.list ];then
printf "\nInstalling PPA\n" elif command -v apt >/dev/null 2>&1;then
sudo add-apt-repository ppa:alexlarsson/flatpak
sudo apt update
sudo apt install flatpak sudo apt install flatpak
else
sudo apt install flatpak
fi
else else
printf "\nUnsupported Operating System" printf "\nUnsupported Operating System"
fi fi
@@ -28,7 +20,7 @@ installFlatpak(){
addFlatpakRepo(){ addFlatpakRepo(){
if [ -f ${flatpakBin} ];then if command -v flatpak >/dev/null 2>&1;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
@@ -38,13 +30,13 @@ addFlatpakRepo(){
getPackages(){ getPackages(){
echo -e "\nInstalling Shortwave..\n" echo -e "\nInstalling Shortwave..\n"
flatpak install flathub shortwave -y flatpak install flathub de.haeckerfelix.Shortwave -y
echo -e "\nInstalling Adapta Theme...\n" echo -e "\nInstalling Adapta Theme...\n"
flatpak install flathub org.gtk.Gtk3theme.Adapta-Nokto-Eta flatpak install flathub org.gtk.Gtk3theme.Adapta-Nokto-Eta
echo -e "Installing Bitwarden...\n" echo -e "Installing Bitwarden...\n"
flatpak install flathub bitwarden -y flatpak install flathub com.bitwarden.desktop -y
} }
helpFile(){ helpFile(){
@@ -68,4 +60,8 @@ case ${1} in
-r) -r)
addFlatpakRepo addFlatpakRepo
;; ;;
*)
helpFile
;;
esac esac