diff --git a/system_files/desktop/shared/usr/bin/bazzite-flatpak-manager b/system_files/desktop/shared/usr/bin/bazzite-flatpak-manager index 3eb72624..19f2f4be 100755 --- a/system_files/desktop/shared/usr/bin/bazzite-flatpak-manager +++ b/system_files/desktop/shared/usr/bin/bazzite-flatpak-manager @@ -21,30 +21,22 @@ fi # Ensure Flathub is enabled flatpak remote-modify --system --enable flathub -# Installed flatpaks +# Lists of flatpaks FLATPAK_LIST=$(flatpak list --columns=application) - -# Flatpak list files -INSTALL_LIST_FILE="/usr/share/ublue-os/bazzite/flatpak/install" -REMOVE_LIST_FILE="/usr/share/ublue-os/bazzite/flatpak/remove" +INSTALL_LIST=$(cat /usr/share/ublue-os/bazzite/flatpak/install) +REMOVE_LIST=$(cat /usr/share/ublue-os/bazzite/flatpak/remove) # Install flatpaks in list -if [[ -f $INSTALL_LIST_FILE ]]; then - INSTALL_LIST=$(echo $FLATPAK_LIST | grep -vf - $INSTALL_LIST_FILE) - if [[ -n $INSTALL_LIST ]]; then - if ! flatpak install --system --noninteractive flathub ${INSTALL_LIST[@]}; then - # exit on error - exit 1 - fi +if [[ -n $INSTALL_LIST ]]; then + if ! flatpak install --system --noninteractive flathub ${INSTALL_LIST[@]}; then + # exit on error + exit 1 fi fi # Remove flatpaks in list once -if [[ ! -f $VER_FILE && -f $REMOVE_LIST_FILE ]]; then - REMOVE_LIST=$(echo $FLATPAK_LIST | grep -f - $REMOVE_LIST_FILE) - if [[ -n $REMOVE_LIST ]]; then - flatpak remove --system --noninteractive ${REMOVE_LIST[@]} - fi +if [[ ! -f $VER_FILE && -n $REMOVE_LIST ]]; then + flatpak remove --system --noninteractive ${REMOVE_LIST[@]} fi mkdir -p /etc/bazzite