linux中,大家有没有推荐比较好用的中英词典软件?

经常看英文PDF文章,比较关心屏幕取词功能。
我一直用的是有道词典, 但是PDF的取词功能很不稳定。

不知道大家有没有推荐?

之前折腾过两天取词的问题,用xclip取选中的词,然后xdotool自动切换到emacsclient,调用sdcv翻译,退出之后xdotool自动切换回原窗口。麻烦的是wine程序窗口没法用xclip取词,只能用模拟按键的方法取词了。

#!/bin/sh

xte_copy()
{
    case $wine_title in
        *Mozilla\ Firefox* | *Microsoft\ Word* )
            xte <<EOF
sleep 1
keydown Alt_L
key w
keyup Alt_L
sleep 1
EOF
            ;;
        *)
            xte <<EOF
sleep 1
keydown Control_L
key c
keyup Control_L
sleep 1
EOF
            ;;
    esac
}

Wind_wine=`xdotool getwindowfocus -f`

if [ $(xdotool search --onlyvisible --class "wine" | grep -i $Wind_wine) ]; then
    wine_id=`xdpyinfo | sed -ne 's/^focus:.*\(0x[^,]\+\).*/\1/p'`
    if xwininfo -id $wine_id | grep "(has no name)"
    then
        wine_id=`printf "0x%x\n" $(( $wine_id - 1 ))` #Decrement by one.
    fi
    wine_title=`xwininfo -id $wine_id | sed -ne 's/xwininfo: .*"\([^"]\+\)"/\1/p'`
    xte_copy

    Wind_id=$Wind_wine;
    word=$(xclip -selection clipboard -o | sed 's/[\"]/\\&/g')
else
    Wind_id=`xdotool getactivewindow`;
    word=$(xclip -selection primary -o | sed 's/[\"]/\\&/g')
fi

run-or-raise.sh emacs
sleep 0.1
emacsclient -e "(progn (swint-sdcv-to-buffer (substring-no-properties \"$word\")) (start-process-shell-command \"ec_sleep\" \"*ec_sleep*\" \"ec_sleep.sh\"))"

while /bin/true; do
    ps cax | grep sleep > /dev/null
    [ $? -ne 0 ] && xdotool windowactivate --sync $Wind_id && exit 0
    sleep 1
done

我曾经把文章复制到 Emacs 下再看,Spacemacs 有多种翻译可选……

好吧,要是能匿名我就匿名回答了……

大神已经深入细节了,可是我功力不够,没有看懂,不明觉厉!

话说这也是一种方法啊!
不过有些格式上似乎不太好处理,只能复制文本吧?
要是公开的文献资料也提供类似 .org 的纯文本格式就好了。

我都在terminal里用translate-shell手打(

我用goldendict

pdf的问题其实还是阅读器的问题,现在用emacs看pdf都是直接复制词……