suckless_dictpopup/dictpopup
2023-05-10 19:52:26 +02:00

11 lines
296 B
Bash
Executable file

#!/bin/sh
selection=$(sselp)
dict_lookup=$(sdcv -n --utf8-output -e "$selection")
if echo "$dict_lookup" | grep -F "Nothing similar to"; then
notify-send "Nothing found for: $selection"
else
echo "$dict_lookup" | tail -n +5 | sed 's|<br>|\n|g' | sed 's|<[^>]*>||g' | xargs -d '\n' popup
fi