From 5c916d69d457101326803eb076a746060e3618cf Mon Sep 17 00:00:00 2001 From: Vikas Kushwaha Date: Thu, 21 Nov 2024 13:30:52 +0530 Subject: Moved from github --- .local/bin/fdict | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100755 .local/bin/fdict (limited to '.local/bin/fdict') diff --git a/.local/bin/fdict b/.local/bin/fdict new file mode 100755 index 0000000..8a4ed61 --- /dev/null +++ b/.local/bin/fdict @@ -0,0 +1,25 @@ +#!/bin/sh + +# fzf-dict: get word definitions using sdcv + +mkdir -pv ~/.local/share/fzf +export SDCV_PAGER="less -R" + +if [ "$OPENFLAG" = 0 ]; then + sdcv --color \ + -u 'WordNet® 3.0 (En-En)' \ + -u 'American Heritage Dictionary 4th Ed. (En-En)' \ + -u 'Urban Dictionary P1 (En-En)' \ + -u 'Urban Dictionary P2 (En-En)' \ + "$@" + sdcv -u 'Wikipedia English - Free Encyclopedia' "$@" | w3m -T text/html + exit +fi + +grep -v \' "${PREFIX:-/usr}/share/dict/words" | fzf \ + --history "$HOME/.local/share/fzf/word_history" \ + --header "Startdict Dictionary" --header-first \ + --preview='OPENFLAG=0 fzf-words {} | fold -sw "$FZF_PREVIEW_COLUMNS"' \ + --preview-window='nohidden,75%' --tiebreak=begin --print-query \ + --bind 'alt-enter:execute(OPENFLAG=0 fzf-words {q})' \ + --bind 'enter:execute(OPENFLAG=0 fzf-words {})' -- cgit v1.2.3