suckless_dictpopup/dictpopup

15 lines
292 B
Plaintext
Raw Normal View History

2023-05-09 10:42:03 +00:00
#!/bin/sh
2023-05-30 21:00:41 +00:00
word=${1:-$(sselp)}
2023-06-03 01:22:57 +00:00
dict_lookup=$(sdcv -n --utf8-output -e "$word")
if echo "$dict_lookup" | perl -0777 -ne 'exit 0 if /Nothing similar to/ ; exit 1'; then
echo "$dict_lookup" | popup
else
echo "$dict_lookup" | tail -n +5 | perl -pe 's/<[^>]*>//g' | popup
fi