suckless_dictpopup/dictpopup
2023-05-11 12:17:45 +02:00

11 lines
299 B
Bash
Executable file

#!/bin/sh
selection=$(xclip -o)
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