From 7fafe84620937f7e00d35bf995efc533b2ff3e7e Mon Sep 17 00:00:00 2001 From: Mollusk Date: Thu, 29 Oct 2026 14:59:00 -0400 Subject: [PATCH] flatjerk.sh: fix flatpak/apt/xbps detection and app IDs, add help fallback Co-Authored-By: Claude Opus 5.5 --- flatjerk.sh | 32 ++++++++++++++------------------ 1 file changed, 14 insertions(+), 18 deletions(-) diff --git a/flatjerk.sh b/flatjerk.sh index 3ed3f77..5274d57 100755 --- a/flatjerk.sh +++ b/flatjerk.sh @@ -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 - sudo apt install flatpak - else - sudo apt install flatpak - fi + 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 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 \ No newline at end of file