dotfiles/.local/bin/dictionary
mintycube 3c433a3457 Add dictionary to zathura
Made a bash script and used dwn to set the keybind for it. dictd for the
dictionary. WordNet for the database. st for the ui
2024-05-04 19:49:22 +05:00

15 lines
412 B
Bash
Executable File
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

#!/usr/bin/env bash
word=$(xclip -o -selection "clipboard")
if [ -z "$word" ]; then
notify-send "No query."
exit 1
fi
st \
-n "dictionary" \
-g 74x20+800 \
-f "JetBrainsMono Nerd Font:size=12" \
sh -c "dict -d wn \"$word\" | colorit | sed -e '1,3d' -e 's/\[34;47m//g' | bat --style=plain --paging=always";