This commit is contained in:
Eric Lay 2020-06-15 14:55:13 -05:00
parent 6652b70cc8
commit 2d0046b77f
4 changed files with 10 additions and 30 deletions

View File

@ -18,15 +18,4 @@ package() {
install -dm755 $pkgdir/usr/bin
cp -r $srcdir/$pkgname/fpf $pkgdir/usr/bin/
chmod a+x $pkgdir/usr/bin/*
install -dm755 "$pkgdir"/usr/lib/systemd/system/
install -m644 $srcdir/$pkgname/fpf.{service,timer} "$pkgdir"/usr/lib/systemd/system/
echo
echo
echo -------------------------------------
echo 'Please start/enable fpf service'
echo 'See git installation instructions'
echo -------------------------------------
echo
echo
}

14
fpf
View File

@ -1,8 +1,9 @@
#!/usr/bin/bash
### Set up package lists
pacman -Slq > /tmp/packages &
### Help
Help() {
echo
echo "Use fzf to search and install with Pacman and Yay"
@ -20,11 +21,14 @@ Help() {
}
### MAIN
while getopts ":yh" option; do
case $option in
y) yay -Sl | awk '{print $2($4=="" ? "" : " *")}'| fzf -e -m --preview 'cat <(yay -Si {1}) <(yay -Fl {1} | awk "{print \$2}")' --layout=reverse | xargs -ro -n1 yay -S
y)
wget -P /tmp/aur/ https://aur.archlinux.org/packages.gz >/dev/null 2>&1 && gunzip -f /tmp/aur/packages.gz && cat /tmp/aur/packages >> /tmp/packages
yay -Qq > /tmp/local_packages
cat /tmp/packages /tmp/local_packages | sort | uniq > /tmp/all_packages
cat /tmp/packages | awk '{print $2($4=="" ? "" : " *")}'| fzf -e -m --preview 'cat <(yay -Si {1}) <(yay -Fl {1} | awk "{print \$2}")' --layout=reverse | xargs -ro -n1 yay -S
exit;;
h) Help
@ -36,4 +40,6 @@ while getopts ":yh" option; do
esac
done
pacman -Sl | awk '{print $2($4=="" ? "" : " *")}'| fzf -e -m --preview 'cat <(pacman -Si {1}) <(pacman -Fl {1} | awk "{print \$2}")' --layout=reverse | xargs -ro -n1 sudo pacman -S
pacman -Qq > /tmp/local_packages
cat /tmp/packages /tmp/local_packages | sort | uniq > /tmp/all_packages
cat /tmp/all_packages | awk '{print $2($4=="" ? "" : " *")}'| fzf -e -m --preview 'cat <(pacman -Si {1}) <(pacman -Fl {1} | awk "{print \$2}")' --layout=reverse | xargs -ro -n1 sudo pacman -S

View File

@ -1,7 +0,0 @@
[Unit]
Description=Sync files database
[Service]
Type=oneshot
User=root
ExecStart=/usr/bin/sh -c 'pacman -Fy'

View File

@ -1,8 +0,0 @@
[Unit]
Description=Periodically sync files database
[Timer]
OnUnitInactiveSec=24hours
[Install]
WantedBy=multi-user.target