/usr/lib/surfraw/archwiki is in surfraw 2.2.9-1.
This file is owned by root:root, with mode 0o755.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 | #!/bin/sh
# elvis: archwiki -- Search the Arch Linux Wiki
# Author: http://jasonwryan.com
. surfraw || exit 1
w3_config_hook () {
def SURFRAW_archwiki_language "$SURFRAW_lang"
}
w3_usage_hook () {
cat <<EOF
Usage: $w3_argv0 [options] [search-string]
Description:
Search the Arch Linux Wiki (wiki.archlinux.org)
Local options
-language=ISOCODE Two letter language code (resembles ISO country codes)
-l=ISOCODE
en | Main Arch Wiki site (default)
fr | French
de | German
he | Hebrew
pl | Polish
pt | Portugese
ro | Romanian
es | Spanish
sv | Swedish
uk | Ukranian
Environment: SURFRAW_archwiki_language, SURFRAW_lang
Default: en
EOF
w3_global_usage
}
w3_parse_option_hook () {
opt="$1"
optarg="$2"
case "$opt" in
-language=*) setopt SURFRAW_archwiki_language $optarg ;;
-l=*) setopt SURFRAW_archwiki_language $optarg ;;
*) return 1 ;;
esac
return 0
}
w3_config
w3_parse_args "$@"
# w3_args now contains list of arguments
case "$SURFRAW_archwiki_language" in
en) domain=".org" ;;
fr) domain=".fr" ;;
de) domain=".de" ;;
he) domain=".il" ;;
pl) domain=".pl" ;;
pt) domain="-br.org" ;;
ro) domain=".ro" ;;
es) domain=".cl" ;;
sv) domain=".sv" ;;
uk) domain=".ua" ;;
*) domain=".org" ;;
esac
# handle ssl
if [ $domain = ".org" -o $domain = ".de" ]; then
protocol="https://";
else
protocol="http://";
fi
if [ -z "$w3_args" ]; then
w3_browse_url "${protocol}wiki.archlinux${domain}/"
else
escaped_args=$(w3_url_of_arg $w3_args)
w3_browse_url "${protocol}wiki.archlinux${domain}/index.php?search=${escaped_args}"
fi
|