improvements to flatpak
This commit is contained in:
+1
-1
@@ -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
|
||||
|
||||
@@ -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"
|
||||
|
||||
@@ -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..."
|
||||
|
||||
@@ -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
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user