Add 'w4m' wrapper script

This commit is contained in:
samedamci 2020-05-18 20:42:36 +02:00
parent 84ca2f01b7
commit b1186901b7
No known key found for this signature in database
GPG Key ID: FCB4A9A20D00E894

16
.local/bin/scripts/w4m Executable file
View File

@ -0,0 +1,16 @@
#!/bin/sh
# Simple w3m wrapper with CLI search engine "support".
# This script allow to search in DDG or use bangs* from the command line and
# still use full site URLs.
# *In Z Shell you must escape exclamation point with backslash.
# e.g.: `w4m \!gh` or `w4m "how to do xyz"`
if echo "$1" | grep -q '[a-z|0-9]\.[a-z|0-9]'; then
w3m "$1"
elif [ ! "$1" ]; then
w3m "https://duckduckgo.com/lite"
else
w3m "https://duckduckgo.com/?q=$1"
fi