equery2bookmarks (801B)
- #!/bin/sh
- # Puts the homepage of all installed packages into XBEL bookmarks (for badwolf)
- (
- cat <<EOF
- <?xml version="1.0" encoding="UTF-8"?>
- <!DOCTYPE xbel PUBLIC "+//IDN python.org//DTD XML Bookmark Exchange Language 1.0//EN//XML"
- "http://www.python.org/topics/xml/dtds/xbel-1.0.dtd">
- <xbel>
- EOF
- #equery l -F '$cp' '*/*' \
- # | while read pkg; do
- # cat "/var/db/pkg/${pkg}"*"/HOMEPAGE" \
- # | tr ' ' '\n' \
- # | sed -r -e 's/\&/\&/' -e 's;(.*);<bookmark href="\1"><title>'$pkg'</title></bookmark>;'
- # done 2>/dev/null \
- # | sort -u
- ls /var/db/pkg/*/*/HOMEPAGE \
- | xargs cat \
- | tr ' ' '\n' \
- | sort -u \
- | sed -r -e 's/\&/\&/' -e 's;(.*);<bookmark href="\1"><title>\1</title></bookmark>;'
- echo '</xbel>'
- ) > ${XDG_DATA_HOME:-$HOME/.local/share}/badwolf/bookmarks-equery.xbel