From a45a2a7ecaf807fcaad29e879a347e7fa511273c Mon Sep 17 00:00:00 2001 From: gotbletu Date: Sat, 24 Jul 2021 02:21:43 -0700 Subject: [PATCH] use spaces, no more semicolon for url input --- w3m_plugins/cgi-bin/search_engines.cgi | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/w3m_plugins/cgi-bin/search_engines.cgi b/w3m_plugins/cgi-bin/search_engines.cgi index 8d9c26a..3709fb9 100755 --- a/w3m_plugins/cgi-bin/search_engines.cgi +++ b/w3m_plugins/cgi-bin/search_engines.cgi @@ -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: : # 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")