diff options
author | Sigrid <ftrvxmtrx@gmail.com> | 2021-03-02 08:21:56 +0100 |
---|---|---|
committer | Sigrid <ftrvxmtrx@gmail.com> | 2021-03-02 08:21:56 +0100 |
commit | 2aba7615afdabfdef8e02d162ffee2ecdf3e39e9 (patch) | |
tree | 1184800b0357bf0f361d18113599ac6c85865c75 /sys/src/cmd/mothra/mothra.c | |
parent | f234b29c7fc119fa148af2108f93e5eaf9ecbfb4 (diff) |
mothra: add "d" command to search for a text on the internet (using duckduckgo)
Diffstat (limited to 'sys/src/cmd/mothra/mothra.c')
-rw-r--r-- | sys/src/cmd/mothra/mothra.c | 10 |
1 files changed, 10 insertions, 0 deletions
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'){ |