summaryrefslogtreecommitdiff
path: root/bin
diff options
context:
space:
mode:
Diffstat (limited to 'bin')
-rwxr-xr-xbin/extra/wd14
1 files changed, 14 insertions, 0 deletions
diff --git a/bin/extra/wd b/bin/extra/wd
new file mode 100755
index 0000000..1aa2c6e
--- /dev/null
+++ b/bin/extra/wd
@@ -0,0 +1,14 @@
+#!/bin/sh
+
+### Word Definition
+# Based on https://askubuntu.com/questions/191125/is-there-an-offline-command-line-dictionary
+#
+### Installation
+# > sudo mkdir -p /usr/share/stardict/dic/
+## Get the dictionaries
+# > wget https://web.archive.org/web/20140428003644/http://abloz.com/huzheng/stardict-dic/dict.org/stardict-dictd_www.dict.org_gcide-2.4.2.tar.bz2
+# > wget https://web.archive.org/web/20140428004049/http://abloz.com/huzheng/stardict-dic/misc/stardict-xfardic-gnu-linux-2.4.2.tar.bz2
+
+sdcv -nj "$1" |
+ jq -r '.[].definition' |
+ sed -e '/^$/d;s/^[^ ].*$/\o033[1;4;38m&\o033[0m/'