forked from jdpedersen1/scripts
-
Notifications
You must be signed in to change notification settings - Fork 0
/
vsp2
executable file
·36 lines (31 loc) · 1.22 KB
/
vsp2
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
#!/usr/bin/env bash
#pkg="$(ls ~/.local/pkgs/void-packages/srcpkgs | dmenu -i -fn Hermit:size=10 -nb '#222222' -sb '#007687' -sf '#222222' -nf '#b8b8b8' -l 10 -g 7 -p "What would you like to install? :")"
pkg="$(ls ~/.local/pkgs/void-packages/srcpkgs | fzf --prompt="Search Void-src pkgs : " --border=rounded --margin=5% --color='fg:104,fg+:255,pointer:12,hl:255,hl+:12,header:12,prompt:255' --height 100% --reverse --header=" Templates " --info=hidden --header-first)"
DIR1=$HOME/.local/pkgs/void-packages/
DIR2=$HOME/.local/pkgs/void-packages/srcpkgs
CHECK="$(xbps-query -s "$pkg" | wc -l)"
if [ "$pkg" ]
then
if [ "$CHECK" -eq "1" ]
then
notify-send "You are good to go, program already installed! have a wonderful day, gorgeous!"
sleep 2
exit
else
cd "$DIR1" || exit
git pull
cd "$DIR2" || exit
if [[ -d "$pkg" ]]
then
cd "$DIR1" || exit
notify-send -t 60000 "installing $pkg, Please be patient"
./xbps-src pkg "$pkg" && sudo xbps-install -Sy --repository hostdir/binpkgs "$pkg"
else
notify-send "Not found"
exit
fi
fi
else
exit
fi
notify-send "$pkg installed"