update website publish script

This commit is contained in:
2025-06-15 17:05:09 +02:00
parent a58c51fd4a
commit 1e1bb5caab
3 changed files with 47 additions and 1 deletions

45
scripts/pcs-clean-config Executable file
View File

@ -0,0 +1,45 @@
#!/bin/bash
# Get list of config folders
CONFIG_DIR="$HOME/.config"
CONFIG_FOLDERS=($(find "$CONFIG_DIR" -mindepth 1 -maxdepth 1 -type d -printf "%f\n"))
# Get list of installed APT packages
APT_PACKAGES=($(dpkg -l | awk '{print $2}' | tail -n +6))
# Get list of installed Flatpak apps (application IDs only)
FLATPAK_APPS=($(flatpak list --app --columns=application))
# Combine all installed package names
INSTALLED_APPS=("${APT_PACKAGES[@]}" "${FLATPAK_APPS[@]}")
# Initialize list of redundant config folders
REDUNDANT=()
for folder in "${CONFIG_FOLDERS[@]}"; do
FOUND=0
for app in "${INSTALLED_APPS[@]}"; do
if [[ "$folder" == "$app" ]]; then
FOUND=1
break
fi
done
if [[ $FOUND -eq 0 ]]; then
REDUNDANT+=("$CONFIG_DIR/$folder")
fi
done
# Output results
COUNT=${#REDUNDANT[@]}
if [[ $COUNT -eq 0 ]]; then
echo "No redundant config folders found."
else
echo "$COUNT redundant config folders found:"
for path in "${REDUNDANT[@]}"; do
echo "- $path"
done
echo
echo "To remove them, run:"
echo "rm -r ${REDUNDANT[*]}"
fi