securityos/public/Users/Public/Documents/Dotfiles/Gentoo/dwm/dmenu/src-script

35 lines
758 B
Plaintext
Raw Normal View History

2024-09-06 15:32:35 +00:00
#!/usr/bin/env bash
pkg="$(ls ~/void-packages/srcpkgs | dmenu -i -p "Src-Packages ")"
DIR1=$HOME/void-packages/
DIR2=$HOME/void-packages/srcpkgs
CHECK="$(xbps-query -s "$pkg" | wc -l)"
if [ $pkg ]
then
if [ "$CHECK" -eq "1" ]
then
notify-send "Programa Instalado!"
sleep 2
exit
else
cd "$DIR1" || exit
git pull
cd "$DIR2" || exit
if [[ -d "$pkg" ]]
then
cd "$DIR1" || exit
notify-send -t 60000 "Instalando $pkg"
./xbps-src pkg "$pkg" && xi --repository hostdir/binpkgs "$pkg"
else
notify-send "Not found"
exit
fi
fi
else
exit
fi
notify-send "$pkg instalado!"