- #!/bin/sh
- #terminal="urxvt -e"
- #tmpfile="/tmp/ddict.lookup.$$"
- #Requires python2-ddg package
- word=$(xsel -o | dmenu -p 'DuckDuckGo Lookup:') || exit
- while [[ $word != "" ]]; do
- oup=$(ddg "$word" 2>&1)
- if [[ $? -eq 21 ]]; then
- word=$(echo -e "$oup" | cut -d: -f2 | xargs -n1 | sort -u -f | dmenu -p 'Did you mean:') || exit
- else
- notify-send -a DuckDuckGo -i /home/eddie/.icons/logo_square.64.png "$word" "$oup"
- break
- fi
- done
|