|
|
|
@ -26,23 +26,22 @@
|
|
|
|
|
# 3. chmod +x ~/.w3m/cgi-bin/search_engines.cgi
|
|
|
|
|
# 4. sed -i 's@cgi_bin.*@cgi_bin ~/.w3m/cgi-bin:/usr/lib/w3m/cgi-bin:/usr/local/libexec/w3m/cgi-bin@g' ~/.w3m/config
|
|
|
|
|
# 5. sed -i 's@urimethodmap.*@urimethodmap ~/.w3m/urimethodmap, /usr/etc/w3m/urimethodmap@g' ~/.w3m/config
|
|
|
|
|
# 6. sed -i 's@space_autocomplete.*@space_autocomplete 0@g' ~/.w3m/config
|
|
|
|
|
# USAGE: <SearchEngine>:<Keywords;Use;SemiColon;As;Spaces>
|
|
|
|
|
# 1. $ w3m -v
|
|
|
|
|
# 2. press Shift-u (the default GOTO key) to access the addressbar
|
|
|
|
|
# 3. press Ctrl-u to clear addressbar
|
|
|
|
|
# 4. to search duckduckgo type in dd:linux;wallpapers
|
|
|
|
|
# 5. to search google type in gg:anime;wallpapers
|
|
|
|
|
# CLOG: 2021-05-24 turn @felipesaa script into posix, use case statement looks prettier
|
|
|
|
|
|
|
|
|
|
# 4. to search duckduckgo type in dd:cool linux wallpapers
|
|
|
|
|
# 5. to search google type in gg:cool anime wallpapers
|
|
|
|
|
# CLOG:
|
|
|
|
|
# 2021-07-24 remove semicolon requirements, use spaces instead by enabling (space_autocomplete 0)
|
|
|
|
|
# 2021-05-24 turn @felipesaa script into posix, use case statement looks prettier
|
|
|
|
|
|
|
|
|
|
# search engine alias
|
|
|
|
|
# dd:linux;wallpapers --> dd
|
|
|
|
|
PREFIX=$(echo "$QUERY_STRING" | cut -d ':' -f1)
|
|
|
|
|
|
|
|
|
|
# user input keywords
|
|
|
|
|
# dd:linux;wallpapers --> linux;wallpapers --> linux%20wallpapers
|
|
|
|
|
# [Note] w3m does not allow spaces in addressbar so using ';' as 'space' instead
|
|
|
|
|
INPUT=$(echo "$QUERY_STRING" | cut -d ':' -f2- | sed 's/;/%20/g')
|
|
|
|
|
INPUT=$(echo "$QUERY_STRING" | cut -d ':' -f2-)
|
|
|
|
|
|
|
|
|
|
# check if w3m version has native gopher support
|
|
|
|
|
GOPHER_PROTOCOL_ENABLE=$(w3m -version | grep -c "gopher")
|
|
|
|
|