35 lines
758 B
Plaintext
35 lines
758 B
Plaintext
|
#!/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!"
|