Skip to content
This repository has been archived by the owner on Feb 19, 2024. It is now read-only.

[pull] bluefin-main from ublue-os:main #61

Merged
merged 1 commit into from
Dec 19, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 8 additions & 15 deletions usr/bin/ublue-system-flatpak-manager
Original file line number Diff line number Diff line change
Expand Up @@ -18,27 +18,20 @@ fi

# Lists of flatpaks
FLATPAK_LIST=$(flatpak list --columns=application)
INSTALL_LIST_FILE="/etc/flatpak/system/install"
REMOVE_LIST_FILE="/etc/flatpak/system/remove"

INSTALL_LIST=$(cat /etc/flatpak/system/install)
REMOVE_LIST=$(cat /etc/flatpak/system/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

# Opt out of and remove Fedora's flatpak repo
Expand Down
22 changes: 8 additions & 14 deletions usr/bin/ublue-user-flatpak-manager
Original file line number Diff line number Diff line change
Expand Up @@ -16,26 +16,20 @@ flatpak remote-add --if-not-exists --user flathub /etc/flatpak/remotes.d/flathub

# Lists of flatpaks
FLATPAK_LIST=$(flatpak list --columns=application)
INSTALL_LIST_FILE="/etc/flatpak/user/install"
REMOVE_LIST_FILE="/etc/flatpak/user/remove"
INSTALL_LIST=$(cat /etc/flatpak/user/install)
REMOVE_LIST=$(cat /etc/flatpak/user/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 --user --noninteractive flathub ${INSTALL_LIST[@]}; then
# exit on error
exit 1
fi
if [[ -n $INSTALL_LIST ]]; then
if ! flatpak install --user --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 --user --noninteractive ${REMOVE_LIST[@]}
fi
if [[ ! -f $VER_FILE && -n $REMOVE_LIST ]]; then
flatpak remove --user --noninteractive ${REMOVE_LIST[@]}
fi

notify-send "Flatpak installer" "Finished installing user flatpaks" --app-name="Flatpak installer" -u NORMAL
Expand Down