diff options
-rwxr-xr-x | sys/man/1/mothra | 5 | ||||
-rw-r--r-- | sys/src/cmd/mothra/mothra.c | 10 |
2 files changed, 15 insertions, 0 deletions
diff --git a/sys/man/1/mothra b/sys/man/1/mothra index bee49830c..364c9dfc8 100755 --- a/sys/man/1/mothra +++ b/sys/man/1/mothra @@ -132,6 +132,11 @@ The typed commands are: .B a Toggle alt display. .TP +.BI d " text +Search for the given +.I text +on the internet. +.TP .BI g " url Go to the page with the given URL. .TP diff --git a/sys/src/cmd/mothra/mothra.c b/sys/src/cmd/mothra/mothra.c index 84d3fbced..09a50329c 100644 --- a/sys/src/cmd/mothra/mothra.c +++ b/sys/src/cmd/mothra/mothra.c @@ -675,6 +675,16 @@ void docmd(Panel *p, char *s){ if(*s=='\0' && selection) hit3(3, 0); break; + case 'd': + s = arg(s); + if(*s){ + s = smprint("https://duckduckgo.com/html/?q=%U", s); + if(s != nil) + geturl(s, -1, 0, 0); + free(s); + }else + message("Usage: d text"); + break; case 'g': s = arg(s); if(*s=='\0'){ |