work in progress

This commit is contained in:
Eric Lay 2020-06-22 14:43:06 -05:00
parent 2f58f64fac
commit 534c96ccf4
1 changed files with 15 additions and 4 deletions

19
fpf
View File

@ -1,7 +1,7 @@
#!/usr/bin/bash
### Set up package lists
pacman -Slq >/dev/null 2>&1 /tmp/packages
pacman -Slq | sort > /tmp/packages
### Help
Help() {
@ -24,9 +24,20 @@ Help() {
# Test for AUR option, if not run with pacman
if [[ -z "$1" ]]; then
pacman -Qq > /tmp/local_packages
cat /tmp/packages /tmp/local_packages | sort | uniq > /tmp/all_packages
cat /tmp/all_packages |fzf -e -m --preview 'cat <(pacman -Si {1}) <(pacman -Fl {1} | awk "{print \$2}")' --layout=reverse --prompt='Select packages to install (use TAB to toggle selection) >' | xargs -ro -n1 sudo pacman -S
echo "Setting things up..."
# echo -e "$(pacman -Qqe)\n" > /tmp/local_packages
# counter=1
# while IFS= read -r line; do
# sed -i -e '/$line/ s/.*/"$line" */g' /tmp/packages
# counter=$((counter+1))
# done < /tmp/local_packages
mapfile -t local_pkgs < <(pacman -Qqe)
for line in "${local_pkgs[@]}"; do
sed -i "s/${line}/${line} */" /tmp/packages
done
unset local_pkgs
cat /tmp/packages |fzf -e -m --preview 'cat <(pacman -Si {1}) <(pacman -Fl {1} | awk "{print \$2}")' --layout=reverse --prompt='Select packages to install (use TAB to toggle selection) >' | xargs -ro -n1 sudo pacman -S
clear
fi
while getopts ":yh" option; do