-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpkg
More file actions
executable file
·32 lines (29 loc) · 1.06 KB
/
pkg
File metadata and controls
executable file
·32 lines (29 loc) · 1.06 KB
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
#!/bin/bash
action=$(echo -e "Install Program\nRemove Program\nRemove Orphans\nUpdate System" | dmenu -p "Software Manager: " -i)
case $action in
"Install Program")
package=$(pacman -Si |
awk '/^Name/{name=$3} /^Download Size/{ds=$4$5} /^Repo/{repo=$3} /^Description/{sub(/^.{18}/,"", $0); print name, "["ds"]", "("repo") =>", $0} ' |
sort -d | dmenu -i -l 20 | awk '{print $1}')
sudo pacman -S --noconfirm $package
notify-send " $package is installed "
;;
"Remove Program")
package=$(pacman -Qi |
awk '/^Name/{name=$3} /^Installed Size/{ds=$4$5} /^Repo/{repo=$3} /^Description/{sub(/^.{18}/,"", $0); print name, "["ds"] =>", $0} ' |
sort -d | dmenu -i -l 25 | awk '{print $1}')
sudo pacman -R --noconfirm $package
notify-send " $package is removed "
;;
"Remove Orphans")
sudo pacman -Rs $(pacman -Qqtd)
notify-send " Orphan packages deleted "
;;
"Update System")
sudo pacman -Syu --noconfirm
notify-send " System Update Complete"
;;
*)
notify-send " No Option Selected"
;;
esac