improvements to flatpak

This commit is contained in:
2026-10-21 16:41:39 -06:00
parent 9c526b7af1
commit 573f257e42
4 changed files with 9 additions and 5 deletions
+1 -1
View File
@@ -53,7 +53,7 @@ FLATPAKS=(
for pak in "${FLATPAKS[@]}"; do
if ! flatpak list | grep -i "$pak" &> /dev/null; then
echo "Installing Flatpak: $pak"
flatpak install --noninteractive "$pak"
sudo flatpak install --system --noninteractive "$pak"
else
echo "Flatpak already installed: $pak"
fi
+4 -1
View File
@@ -3,7 +3,10 @@
COREDESKTOP="$HOME/.local/share/coredesktop"
echo "Updating Flatpaks..."
flatpak update -y --noninteractive
# System-wide installs need root: --noninteractive suppresses the polkit
# password prompt, so without sudo they fail with "not allowed for user"
sudo flatpak update --system -y --noninteractive
flatpak update --user -y --noninteractive
echo "Checking for new flatpaks..."
. "$COREDESKTOP/install-flatpaks.sh"
+2 -1
View File
@@ -1,7 +1,8 @@
#!/bin/bash
echo "Removing unused Flatpak runtimes..."
flatpak uninstall --unused -y --noninteractive
sudo flatpak uninstall --system --unused -y --noninteractive
flatpak uninstall --user --unused -y --noninteractive
if command -v paccache &>/dev/null; then
echo "Trimming pacman package cache..."
+2 -2
View File
@@ -50,14 +50,14 @@ remove_flatpaks() {
local to_remove=()
for pak in "${flatpaks[@]}"; do
if flatpak list | grep -qi "$pak"; then
if flatpak list --system | grep -qi "$pak"; then
to_remove+=("$pak")
fi
done
if [ ${#to_remove[@]} -ne 0 ]; then
echo "Removing flatpaks: ${to_remove[*]}"
flatpak uninstall --noninteractive "${to_remove[@]}"
sudo flatpak uninstall --system --noninteractive "${to_remove[@]}"
fi
}