You are not logged in.
This is a very simple bash script that I use when I need to visit the official webpage of some package, e.g. to consult online doc (especially useful in Arch since we only have manpages) or submit a bug report. I call this little script pacurl.
#!/bin/bash
url=`pacman -Qi $1 | egrep ^URL | cut -c18-`
[ ! "x$url" == "x" ] && firefox $url
Example: pacurl sed opens the page http://www.gnu.org/software/sed/ in firefox.
If you rather want to open the URL that pertains to some binary instead then you can modifiy the above thus:
#!/bin/bash
path=`which $1`
pkg=`pacman -Qo $path | cut -d' ' -f5`
url=`pacman -Qi $pkg | egrep ^URL | cut -c18-`
[ ! "x$url" == "x" ] && firefox $url
Example: If you name the above script, say, "urlof", then urlof watch will open http://procps.sourceforge.net/
Hope it is useful
Offline
Or, to open the url in a new tab in your running firefox:
// change
// [ ! "x$url" == "x" ] && firefox $url
// to
[ ! "x$url" == "x" ] && firefox --remote "openurl( $url ,new-tab)"
Offline
Or, to open the url in a new tab in your running firefox:
// change // [ ! "x$url" == "x" ] && firefox $url // to [ ! "x$url" == "x" ] && firefox --remote "openurl( $url ,new-tab)"
if I remember well (I probably don't), -t also opens a new tab on the most recent window...
Offline
Improvement to open the URL of uninstalled packages as well. It assumes you have an up-to-date ABS tree under /var/abs.
#!/bin/bash
url=`pacman -Qi $1 2> /dev/null | egrep ^URL | cut -c18-`
if [ "x$url" == "x" ] ; then
echo "Package $1 is not installed. Searching in /var/abs ..."
tmpurl=`mktemp`
find /var/abs -wholename "*/$1/PKGBUILD" -exec egrep ^url '{}' \; > $tmpurl
source $tmpurl
rm $tmpurl
fi
if [ ! "x$url" == "x" ] ; then
firefox --remote "openurl( $url ,new-tab)
else
echo "Not found. Perhaps it is in AUR?"
fi
To search in AUR as well you can change the last three lines by :
else
echo "Not found. Searching in AUR..."
tmpurlaur=`mktemp`
wget -c -q http://aur.archlinux.org/packages/$1/$1/PKGBUILD | egrep ^url > $tmpurlaur
source $tmpurlaur
rm $tmpurlaur
if [ ! "x$url" == "x" ] ; then
firefox --remote "openurl( $url ,new-tab)
else
echo "package $1 found neither in repos nor in AUR"
fi
fi
Offline
A note on the AUR search - the use of URLs of that sort is not recommended, as it is possible to return PKGBUILDs for packages that have been deleted from the AUR.
Any tool that accesses the AUR by any means other than the website has to take this into account. Check the aurbuild/yaourt/etc code for other ways to do this.
Offline
I wondered if something like this could be added to pacman tbh. I was thinking about it a while ago. Nice idea
Offline