mirror of
https://github.com/keanuplayz/dotfiles.git
synced 2024-08-15 02:33:12 +00:00
[scripts/archlinux-packages-menu] add listing of packages from AUR
This commit is contained in:
parent
d421d47569
commit
ee186f7285
1 changed files with 14 additions and 2 deletions
|
@ -1,6 +1,18 @@
|
|||
#!/usr/bin/env bash
|
||||
set -euo pipefail
|
||||
|
||||
if package="$(expac --sync '%r/%a/%n %v - %d' | rofi -dmenu)" && [[ -n "$package" ]]; then
|
||||
xdg-open "https://www.archlinux.org/packages/${package%% *}/"
|
||||
if package="$(set -euo pipefail; {
|
||||
expac --sync '%r/%a/%n %v - %d'
|
||||
curl --silent --location --fail --max-time 3 --compressed https://aur.archlinux.org/packages.gz | awk '!/^#/ { print "aur/" $0 }'
|
||||
} | rofi -dmenu)" && [[ -n "$package" ]]; then
|
||||
|
||||
package="${package%% *}"
|
||||
if [[ "$package" == aur/* ]]; then
|
||||
package="${package#aur/}"
|
||||
url="https://aur.archlinux.org/packages/${package}/"
|
||||
else
|
||||
url="https://www.archlinux.org/packages/${package}/"
|
||||
fi
|
||||
|
||||
xdg-open "$url"
|
||||
fi
|
||||
|
|
Loading…
Reference in a new issue