commit ab8723ae58330bc5b425815d0d56754be943fac6
parent 7985ed7f4cf57f6a892bf04a2cd4ece1c846c7d2
Author: Riaz <riaz@riazj.com>
Date: Sat, 4 Oct 2025 21:54:54 -0700
Update sxhkd configuration for sdcv
Diffstat:
1 file changed, 10 insertions(+), 10 deletions(-)
diff --git a/articles/dictionaries.html b/articles/dictionaries.html
@@ -12,12 +12,19 @@
<h1>Notes on Offline English Dictionaries</h1>
<hr>
<article>
+<pre>export SDCV_PAGER=less</pre>
+<pre>
+alt + d
+ phrase="$(:|dmenu -p "Define:")" && st sdcv "$phrase"
+</pre>
+<h2>Previous Setups</h2>
+<h3>dictd</h3>
<p><a href="https://wiki.archlinux.org/title/Dictd">Install dictd, and configure it to use offline dictionaries.</a></p>
<p>To use dict with dmenu, create an index. The following assumes that you are using the WordNet dictionary.</p>
<pre>
cd ~/.local/state
cp /usr/share/dictd/wn.index .
-sed "s/	.*//g" wn.index | sort -n > wn.tmp && mv wn.tmp wn.index
+sed "s/ .*//g" wn.index | sort -n > wn.tmp && mv wn.tmp wn.index
</pre>
<p>Note that in the sed command above, there is a tab, but your browser might show a space. If you copy it to your clipboard, it should work regardless.</p>
<p>To use this with sxhkd:</p>
@@ -25,16 +32,9 @@ sed "s/	.*//g" wn.index | sort -n > wn.tmp && mv wn.tmp wn.index
alt + shift + d
definition="$XDG_RUNTIME_DIR/dmenu_dict"; \
dict "$(dmenu -i -l 10 < $XDG_STATE_HOME/wn.index)" > "$definition"; \
- [ -s "$definition" ] && st less -+F -c "$definition"
-</pre>
-<p>2025 Aug 8th: I switched back to sdcv since the AUR has a repository with only the WordNet files without its programs.</p>
-<pre>
-alt + d
- def="$XDG_RUNTIME_DIR/sdcv"; \
- sdcv -n "$(:|dmenu -p "Define:")" > "$def"; \
- [ -s "$def" ] && st less "$def"
+ [ -s "$definition" ] && st less -+F -c "$definition"
</pre>
-<p>I no longer use the following hacky setup with GCIDE. Its custom markup sucks.</p>
+<h3>GCIDE</h3>
<pre>
cd gcide
for f in CIDE*; do; mv $f "${f#*.}"; done