pman


Logs | Files | README | README | LICENSE | GitLab


1
commit 73c331a3511785f919e974f9311be4c5932c161d
2
Author: Connor Etherington <[email protected]>
3
Date:   Sat Dec 31 11:33:43 2022 +0200
4
5
    Auto-Commit Update - 20221231
6
---
7
 usr/bin/pman | 136 +++++++++++++++++++++++++++++++++++++++--------------------
8
 1 file changed, 90 insertions(+), 46 deletions(-)
9
10
diff --git a/usr/bin/pman b/usr/bin/pman
11
index 2b90737..5fd95ae 100755
12
--- a/usr/bin/pman
13
+++ b/usr/bin/pman
14
@@ -19,7 +19,7 @@ packages=(
15
  )
16
 
17
 
18
-## If you wish to clone personal GitHub or GitLab repositories,                                                        
19
+## If you wish to clone personal GitHub or GitLab repositories,
20
 ## please enter your own GitHub and/or GitLab username below:
21
 
22
 # GitHub / GitLab Usernames :
23
@@ -30,19 +30,19 @@ labname=""
24
 
25
 
26
 ## Optionally, you can change the color scheme to your prefrence below.
27
-# Your options are as follows:  ( blue, green, red, yellow, white, pink or random )               
28
+# Your options are as follows:  ( blue, green, red, yellow, white, pink or random )
29
 
30
 color1="blue"      # Total Count
31
 color2="pink"      # Package Name
32
 color3="yellow"    # Package Description
33
 
34
 
35
-## PREFIXES AND FORMATTING:
36
-#---
37
+## PREFIXES AND FORMATTING::
38
+# ---
39
 
40
 # Pacman/AUR Package   : <package-name>
41
 
42
-# Gitlab Repo          : L,<gitlab-username>/<repo-name> 
43
+# Gitlab Repo          : L,<gitlab-username>/<repo-name>
44
 # GitHub Repo          : H,<github-username>/<repo-name>
45
 
46
 # Npm Package          : N,<package-name>
47
@@ -56,6 +56,50 @@ color3="yellow"    # Package Description
48
 # Web File / Torrent   : W,<URL>
49
 
50
 
51
+
52
+## PACKAGE TEMPLATES::
53
+
54
+# -------------------------------- #
55
+
56
+# Wine Packages:
57
+
58
+'wine'
59
+'twine'
60
+'q4wine'
61
+'wine-mono'
62
+'wine-nine'
63
+'wine-gecko'
64
+'wine-staging'
65
+'wine-gallium'
66
+'wine-directx'
67
+'libappimage'
68
+'gwenview'
69
+'appimagelauncher '
70
+'lib32-vkd3d-tkg-git'
71
+'proton-ge-custom'
72
+
73
+# -------------------------------- #
74
+
75
+# Mutt ( Email Client ) Packages:
76
+
77
+'libosinfo'
78
+'dmg2img'
79
+'click'
80
+'ardour'
81
+'isync'
82
+'msmtp'
83
+'mailsync'
84
+'pam-gnupg'
85
+'notmuch'
86
+'abook'
87
+'urlview'
88
+'cronie'
89
+'mpop'
90
+
91
+# -------------------------------- #
92
+
93
+
94
+
95
 # See /usr/share/doc/pkgdl/README.md for more information on list formatting.
96
 
97
 ################################################################################################################################
98
@@ -92,24 +136,24 @@ random(){ echo -n  "$(tput bold; tput setaf "$(seq 25|shuf|head -1)") ${*}$(tput
99
 err()   { clear ; echo -e "\n$(tput bold; tput setaf 1)[-] ERROR: ${*}$(tput sgr0)" && exit 1337 ; }
100
 
101
 
102
-scrstart()    { clear ; echo -e "\n\n" ; green "   Downloading Packages : " ; echo  -e "\n\n" || 
103
+scrstart()    { clear ; echo -e "\n\n" ; green "   Downloading Packages : " ; echo  -e "\n\n" ||
104
   red "\n [-] ERROR: Could Not Find '"$1"'\n\n" ; }
105
 
106
 
107
-npminstall()  { sudo npm install -g "$1" >/dev/null 2>&1 && return 0 || 
108
+npminstall()  { sudo npm install -g "$1" >/dev/null 2>&1 && return 0 ||
109
   ! sudo pacman -Qq npm >/dev/null 2>&1 && err "NPM is not installed. Please install it and try again."  ||
110
   red "\n [-] ERROR: Could Not Find '"$1"' in NPM database.\n\n" ; }
111
 
112
-snpinstall()  { sudo snap install "$1" >/dev/null 2>&1 && return 0 || 
113
+snpinstall()  { sudo snap install "$1" >/dev/null 2>&1 && return 0 ||
114
   ! sudo pacman -Qq snapd >/dev/null 2>&1 && err "Snapd is not installed. Please install it and try again." ||
115
   red "\n [-] ERROR: Could Not Find '"$1"'in Snap database.\n\n" ; }
116
 
117
-pkginstall()  { ${helper} -S --needed --noconfirm "$1" >/dev/null 2>&1 && return 0 || 
118
-  $( ${helper} -Si "$1" >/dev/null 2>&1)  && 
119
+pkginstall()  { ${helper} -S --needed --noconfirm "$1" >/dev/null 2>&1 && return 0 ||
120
+  $( ${helper} -Si "$1" >/dev/null 2>&1)  &&
121
   red "\n [-] Errors occurred during install of ${1}. Most likely due to conflicting packages.\n\n" ||
122
   red "\n [-] ERROR: '"$1"' could not be found in package database.\n\n" ; }
123
 
124
-pipinstall()  { sudo python3 -m pip install "$1" >/dev/null 2>&1 && return 0 || 
125
+pipinstall()  { sudo python3 -m pip install "$1" >/dev/null 2>&1 && return 0 ||
126
   ! sudo pacman -Qq python-pip >/dev/null 2>&1 && err "Python-pip is not installed. Please install it and try again." ||
127
   red "\n [-] ERROR: Could Not Find '"$1"' in Python database.\n\n" ; }
128
 
129
@@ -133,7 +177,7 @@ hubclone()    { git clone https://github.com/"$1".git >/dev/null 2>&1 && return
130
   ! sudo pacman -Qq git >/dev/null 2>&1 && err "Git is not installed. Please install it and try again." ||
131
    red "\n [-] ERROR: Could Not Find '"$1"' Git repo.\n\n" ; }
132
 
133
-lnOrTorrent() { aria2c "${1}" >/dev/null 2>&1 && return 0 || 
134
+lnOrTorrent() { aria2c "${1}" >/dev/null 2>&1 && return 0 ||
135
   ! sudo pacman -Qq aria2 >/dev/null 2>&1 && err "NPM is not installed. Please install it and try again." ||
136
   red "\n [-] ERROR: "$1", Could not be download.\n\n" ; }
137
 
138
@@ -144,14 +188,14 @@ testLocal(){ \
139
     --yes-label 'Yes, Install It.' \
140
     --no-label 'No Nevermind.' \
141
     --yesno "\\n${1} cannot be found locally on the system, would you like to install it now?" 6 90 || exit 1
142
-  
143
+
144
   dialog \
145
     --title "$TITLE" \
146
     --infobox "\\nInstalling ${1} ..." 6 35
147
-    
148
+
149
   sudo pacman -S --noconfirm ${1} >/dev/null 2>&1 && return 0
150
 
151
-  ${helper} -S --noconfirm ${1} >/dev/null 2>&1 && return 0 || 
152
+  ${helper} -S --noconfirm ${1} >/dev/null 2>&1 && return 0 ||
153
     err "${1} could not be installed. Please install it manually." ; }
154
 
155
 
156
@@ -199,10 +243,10 @@ testLocal ${editorName}
157
 
158
 [ ! -f ${XDG_DATA_HOME:-$HOME/.local/share}/PKD/pkdrc ] &&
159
   echo -e "#            ~ PKD Config File ~             #\n\n"\
160
-  >> ${XDG_DATA_HOME:-$HOME/.local/share}/PKD/pkdrc 
161
+  >> ${XDG_DATA_HOME:-$HOME/.local/share}/PKD/pkdrc
162
 
163
-! cat ${XDG_DATA_HOME:-$HOME/.local/share}/PKD/pkdrc  >/dev/null 2>&1 | grep -q "editor" && 
164
-  echo "editor=\"${editor}\"" >> ${XDG_DATA_HOME:-$HOME/.local/share}/PKD/pkdrc || 
165
+! cat ${XDG_DATA_HOME:-$HOME/.local/share}/PKD/pkdrc  >/dev/null 2>&1 | grep -q "editor" &&
166
+  echo "editor=\"${editor}\"" >> ${XDG_DATA_HOME:-$HOME/.local/share}/PKD/pkdrc ||
167
   sed -i "s/editor=.*/editor=\"${editor}\"/" ${XDG_DATA_HOME:-$HOME/.local/share}/PKD/pkdrc ; }
168
 
169
 
170
@@ -237,21 +281,21 @@ esac
171
   --yesno "\\nThe selected AUR helper was not found on your system, would you like to install it now?" 6 95
172
 
173
 fetchHelper=$?
174
-  
175
+
176
 [ $fetchHelper = 0 ] && dialog \
177
   --title "$TITLE" \
178
   --infobox "\\nInstalling ${helperName} ..." 6 35 && eval $(\
179
-  sudo pacman -S --noconfirm --needed git >/dev/null 2>&1 
180
+  sudo pacman -S --noconfirm --needed git >/dev/null 2>&1
181
 [ "$(id -u)" -eq 0 ] && err "Please run this script as a normal user, not with elevated privileges (sudo)."
182
-git clone https://aur.archlinux.org/${helperName}.git /tmp/${helperName}.$$ >/dev/null 2>&1 
183
+git clone https://aur.archlinux.org/${helperName}.git /tmp/${helperName}.$$ >/dev/null 2>&1
184
 
185
-cd /tmp/${helperName}.$$ &&  
186
-  makepkg -sri --noconfirm >/dev/null 2>&1 && cd ~/ && 
187
+cd /tmp/${helperName}.$$ &&
188
+  makepkg -sri --noconfirm >/dev/null 2>&1 && cd ~/ &&
189
   sudo rm -rf /tmp/${helperName}.$$ >/dev/null 2>&1 ||
190
   err "Could not install ${helperName}. Please install it manually.")
191
 
192
 ! cat ${XDG_DATA_HOME:-$HOME/.local/share}/PKD/pkdrc >/dev/null 2>&1 | grep -q "helper" &&
193
-  echo -e "helper=\"${helperName}\"" >> ${XDG_DATA_HOME:-$HOME/.local/share}/PKD/pkdrc || 
194
+  echo -e "helper=\"${helperName}\"" >> ${XDG_DATA_HOME:-$HOME/.local/share}/PKD/pkdrc ||
195
   sed -i "s/helper=.*/helper=\"${helperName}\"/" ${XDG_DATA_HOME:-$HOME/.local/share}/PKD/pkdrc ; }
196
 
197
 
198
@@ -273,10 +317,10 @@ source ${XDG_DATA_HOME:-$HOME/.local/share}/PKD/pkdrc
199
 
200
 
201
 case ${1} in
202
-  
203
+
204
   -h|--help) printHelp ;;
205
-  
206
-  -f) echo "packages=(" >${multiDownlist} ; 
207
+
208
+  -f) echo "packages=(" >${multiDownlist} ;
209
 
210
     for CAT in ${@} ; do
211
 
212
@@ -285,7 +329,7 @@ case ${1} in
213
     done ; echo ')' >>$multiDownlist
214
 
215
     source ${multiDownlist} ;;
216
-  
217
+
218
   '') $editor $multiDownlist && source $multiDownlist ;;
219
 
220
   *) packages=( ${@} ) ;;
221
@@ -296,11 +340,11 @@ esac
222
 [ -z $packages ] && err "No packages specified ..."
223
 
224
 
225
-for x in  "${packages[@]}" ; do  
226
+for x in  "${packages[@]}" ; do
227
+
228
+  echo $x >> /tmp/total.tmp
229
 
230
-  echo $x >> /tmp/total.tmp 
231
-  
232
-  sed -i '/^\s*$/d;/^#/d' /tmp/total.tmp 
233
+  sed -i '/^\s*$/d;/^#/d' /tmp/total.tmp
234
 
235
  done ; scrstart
236
 
237
@@ -313,43 +357,43 @@ while IFS=, read -r src pkg desc viewName ; do
238
 
239
   viewName="${pkg}"
240
 
241
-  
242
-  echo ${pkg}|grep -q "^http.*" || echo ${pkg}|grep -q "^www.*" || echo ${pkg}|grep -q "^magnet:\?.*" && 
243
+
244
+  echo ${pkg}|grep -q "^http.*" || echo ${pkg}|grep -q "^www.*" || echo ${pkg}|grep -q "^magnet:\?.*" &&
245
     src='W' && viewName="$(basename ${pkg})"
246
 
247
 
248
   [[ ${src} == 'W' ]] && [[ -z ${desc} ]] && desc="Downloading Link..."
249
 
250
   [[ ${src} == 'MH' ]] && [[ -z ${desc} ]] && desc="Cloning Repo from ${hubname}'s Github ..."
251
-  
252
+
253
   [[ ${src} == 'ML' ]] && [[ -z ${desc} ]] && desc="Cloning Repo from ${hubname}'s Gitlab..."
254
 
255
-  [[ ${src} == 'W' ]] && echo ${pkg} | grep -q "\.torrent$" || echo ${pkg} | grep -q "^magnet:\?.*" && 
256
+  [[ ${src} == 'W' ]] && echo ${pkg} | grep -q "\.torrent$" || echo ${pkg} | grep -q "^magnet:\?.*" &&
257
     viewName="Downloading Torrent File..." && desc=""
258
 
259
 
260
   [[ ${src} == 'L' ]] && [[ -z ${desc} ]] && desc="Cloning from Gitlab..."
261
-  
262
+
263
   [[ ${src} == 'H' ]] && [[ -z ${desc} ]] && desc="Cloning from Github..."
264
 
265
 
266
-  ((n=$n+1)) ; total=$(wc -l < /tmp/total.tmp) ; 
267
-  
268
-  $color1 "( $n of $total ) " 
269
+  ((n=$n+1)) ; total=$(wc -l < /tmp/total.tmp) ;
270
+
271
+  $color1 "( $n of $total ) "
272
 
273
   $color2 $viewName &&  [ -n "$(echo "$desc")" ] && green " - " && $color3 "$desc" ; echo ""
274
-    
275
+
276
 
277
 case "$src" in
278
 
279
-  "W") lnOrTorrent "$pkg" ;; "L") labclone "$pkg"    ;; "ML") mylabclone "$pkg" ;; 
280
+  "W") lnOrTorrent "$pkg" ;; "L") labclone "$pkg"    ;; "ML") mylabclone "$pkg" ;;
281
+
282
+  "S") snpinstall "$pkg"  ;; "N") npminstall "$pkg"  ;; "H") hubclone "$pkg"    ;;
283
 
284
-  "S") snpinstall "$pkg"  ;; "N") npminstall "$pkg"  ;; "H") hubclone "$pkg"    ;; 
285
+  "MH") myhubclone "$pkg" ;;  "") pkginstall "$pkg" ;;  "P") pipinstall "$pkg"  ;;
286
 
287
-  "MH") myhubclone "$pkg" ;;  "") pkginstall "$pkg" ;;  "P") pipinstall "$pkg"  ;; 
288
-   
289
   "F") flatinstall "$pkg" ;; *) echo -e "\n" &&  err ""$src" is  not a valid option for a source. - skipping: "$src" ..."
290
-    
291
+
292
     echo -e "\n" ; sleep 2 ;; esac ; done < /tmp/total.tmp || exit 1
293
 
294
 msg "\n\n\n[+] Download Complete.\n" && sleep 1 && exit 0 || exit 1