Skip to content

Instantly share code, notes, and snippets.

@mal1kc
Created January 22, 2025 09:08
Show Gist options
  • Save mal1kc/81f8b7a144552cdf911892b7ee209466 to your computer and use it in GitHub Desktop.
Save mal1kc/81f8b7a144552cdf911892b7ee209466 to your computer and use it in GitHub Desktop.
#!/usr/bin/env dash
unused_packages_file="$HOME/gecici/unused_packages.txt"
echo "do you want a clean $unused_packages_file file ? y/N"
read -r clean_file
if [ "$clean_file" = "y" ]; then
echo "" >"$unused_packages_file" # clean up
fi
echo "deleting"
yay -Qdtq | gawk '{print $1}' | while read -r pkg; do
yay -Qi "$pkg" | grep -E '^(Name|Description)' >>"$unused_packages_file"
done
echo "deleting"
yay -Qdtq | yay -Rns -
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment