Dev #6

Merged
ericlay merged 9 commits from dev into master 2023-03-29 15:11:28 -05:00
1 changed files with 7 additions and 10 deletions
Showing only changes of commit 043cdade9e - Show all commits

17
fpf
View File

@ -1,9 +1,5 @@
#!/usr/bin/bash #!/usr/bin/bash
declare -r esc=$'\033'
declare -r c_reset="${esc}[0m"
declare -r c_red="${esc}[31m"
### Help ### Help
Help() { Help() {
echo echo
@ -23,8 +19,6 @@ Help() {
echo "R Search/List installed packages for removal" echo "R Search/List installed packages for removal"
echo echo
echo "o Search/List orphaned packages for removal" echo "o Search/List orphaned packages for removal"
echo
echo "u Update Aur package descriptions list"
echo echo
echo "h Print this help screen." echo "h Print this help screen."
echo echo
@ -42,12 +36,15 @@ UpdateInfos() {
} }
UpdateAurInfos() { UpdateAurInfos() {
[ -f /tmp/aur/packages-meta ] || { echo -e "Syncing AUR package database..."; zcat <(curl https://aur.archlinux.org/packages-meta-ext-v1.json.gz) | echo -e "\nSyncing AUR package database...\n"
zcat <(curl https://aur.archlinux.org/packages-meta-ext-v1.json.gz) |
jq --compact-output '.[] | jq --compact-output '.[] |
{ Name, Description } ' | { Name, Description } ' |
awk -F'"' '{ printf "%-20s %s\n", $4, $8}'> /tmp/aur/packages-meta; } awk -F'"' '{ printf "%-20s\t%s\n", $4, $8}' > /tmp/aur/packages-meta
# sort <(comm -23 <(sort /tmp/aur/packages) <(pacman -Qq | sort)) <(comm -12 <(sort /tmp/aur/packages) <(pacman -Qq | sort) | awk '{print $0" \033[32m*\033[0m"}') > /tmp/aur_packages while IFS= read -r pkgName; do
sort -o /tmp/aur/packages-meta{,} grep -w "^$pkgName " /tmp/aur/packages-meta >> /tmp/aur/installed
done < <(pacman -Qqm)
sort <(comm -23 <(cat /tmp/aur/packages-meta | sort) <( cat /tmp/aur/installed | sort)) <(comm -12 <( cat /tmp/aur/packages-meta | sort) <(cat /tmp/aur/installed | sort) | awk -F"\t" '{print $1" \033[32m*\033[0m ", $2}') -o /tmp/aur/packages-meta
echo "$(echo -e ' Select packages to install\n (use TAB to toggle selection)'; cat /tmp/aur/packages-meta)" > /tmp/aur/packages-meta echo "$(echo -e ' Select packages to install\n (use TAB to toggle selection)'; cat /tmp/aur/packages-meta)" > /tmp/aur/packages-meta
} }