Better
[llpp/slowscroll.git] / misc / dicx
blobc9d821a2c0421e3f7ba6a0b99bceb44b0595f72d
1 #!/bin/sh
2 set -e
4 exec 1>&2 2>/dev/null
6 test "$1" = "-" && src="cat" || src="xclip -o"
8 rofi="rofi -dmenu -yoffset 30 -location 2"
10 pag() { \
11 sed -e 1d \
12 -e 's; _\([A-Z]\); \1;p' \
13 -e '/^$/d' -e '/^-->/d' \
14 | eval $rofi -l 20 -p 'Done' >/dev/null
17 phrase="$($src | eval $rofi -markup -p 'Lookup: ')"
18 sdcv -n --utf8-input --utf8-output "$phrase" | pag