-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpint
executable file
·47 lines (40 loc) · 853 Bytes
/
pint
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
36
37
38
39
40
41
42
43
44
45
46
47
#!/usr/bin/env bash
# Pacman INTeractive scripts
# starting oneliners taken from the archwiki, this is just a wrapper
pint_install() {
yay -Slq | fzf -m --height=100% --preview='yay -Si {1}' | xargs -ro sudo yay -S
}
pint_uninstall() {
yay -Qq | fzf -m --height=100% --preview 'yay -Qi {1}' | xargs -ro sudo yay -Rns
}
print_error() {
tput setaf 1
printf -- '[ERR] %s\n' "$*" >&2
tput sgr0
usage
exit 1
}
usage() {
cat <<EOF
Usage: pint <command> [<args>]
Commands are:
-R Remove installed packages
-S Install packages
EOF
}
if (($# > 1)); then
print_error "pint only takes one argument at a time"
elif (($# == 0)); then
print_error "Please provide an argument"
fi
case "$1" in
-R | remove | Remove)
pint_uninstall
;;
-S | install | Install)
pint_install
;;
*)
print_error "No such command '$1'"
;;
esac