summaryrefslogtreecommitdiff
path: root/.w3m/cgi-bin/dictionary.cgi
diff options
context:
space:
mode:
authorluxagraf <sng@luxagraf.net>2023-05-31 13:58:50 -0500
committerluxagraf <sng@luxagraf.net>2023-05-31 13:58:50 -0500
commit58ed0d4b2fd7e023e0c80f623c0103cfbd6e03d6 (patch)
tree04b603bfcc33109b9dbd08c7f60f2c77688fd889 /.w3m/cgi-bin/dictionary.cgi
parentb3aa94d1f0d74fecc02e82609e78e62d3b967bab (diff)
Added scripts and config for w3m
Diffstat (limited to '.w3m/cgi-bin/dictionary.cgi')
-rwxr-xr-x.w3m/cgi-bin/dictionary.cgi18
1 files changed, 18 insertions, 0 deletions
diff --git a/.w3m/cgi-bin/dictionary.cgi b/.w3m/cgi-bin/dictionary.cgi
new file mode 100755
index 0000000..3fc2234
--- /dev/null
+++ b/.w3m/cgi-bin/dictionary.cgi
@@ -0,0 +1,18 @@
+#!/usr/bin/env sh
+# AUTHOR: gotbletu (@gmail|twitter|youtube|github|lbry|odysee)
+# https://www.youtube.com/user/gotbletu
+# DESC: online dictionary lookup using curl
+# DEMO: https://youtu.be/77qhjaoj_2k
+# REQD: 1. chmod +x ~/.w3m/cgi-bin/dictionary.cgi
+# 2. sed -i 's@^cgi_bin.*@cgi_bin ~/.w3m/cgi-bin:/usr/lib/w3m/cgi-bin:/usr/local/libexec/w3m/cgi-bin@g' ~/.w3m/config
+# 3. sed -i 's@^use_dictcommand.*@use_dictcommand 1@g' ~/.w3m/config
+# 4. $EDITOR ~/.w3m/keymap
+# ############################ Execute dictionary command (DICT_WORD)
+# keymap \\\d COMMAND "SET_OPTION dictcommand=file:///cgi-bin/dictionary.cgi ; DICT_WORD"
+# ############################ Execute dictionary command for word at cursor (DICT_WORD_AT)
+# keymap \\\w COMMAND "SET_OPTION dictcommand=file:///cgi-bin/dictionary.cgi ; DICT_WORD_AT"
+
+
+echo "w3m-control: READ_SHELL curl -s dict://dict.org/d:$QUERY_STRING"
+echo "w3m-control: DELETE_PREVBUF"
+echo "w3m-control: REDRAW"