2020-10-28 18:52:59 +00:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
set -euo pipefail
|
|
|
|
|
2020-11-01 14:21:57 +00:00
|
|
|
if package="$(set -euo pipefail; {
|
|
|
|
expac --sync '%r/%a/%n %v - %d'
|
2020-11-07 09:07:03 +00:00
|
|
|
curl --silent --location --fail --max-time 10 --compressed https://aur.archlinux.org/packages.gz | awk '!/^#/ { print "aur/" $0 }'
|
2020-11-01 14:21:57 +00:00
|
|
|
} | 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"
|
2020-10-28 18:52:59 +00:00
|
|
|
fi
|