suckless_dictpopup/dictpopup

11 lines
320 B
Plaintext
Raw Normal View History

2023-05-09 10:42:03 +00:00
#!/bin/sh
2023-05-13 19:22:42 +00:00
# Looks up argument instead, if provided
word=${1:-$(xclip -o)}
[ -z $word ] && exit 1
2023-05-09 10:42:03 +00:00
2023-05-27 19:49:30 +00:00
sdcv -n --utf8-output -e "$word" | tail -n +5 | sed 's|<br>|\n|g' | sed 's|<[^>]*>||g' | xargs -d '\n' popup 2>/dev/null
2023-05-13 19:22:42 +00:00
# Instead of sed also possible:
# `lynx -dump -stdin -assume_charset=UTF-8 -display_charset=UTF-8`