发表于 : 2008-07-16 17:13
支持,能鼠标取词就好了!
aariz 写了:20080717: 优化了发音程序。
20080718: 修复了"xxx'xx" 形式的声音播放BUG。
kingpin 写了:支持,能鼠标取词就好了!
代码: 全选
#!/bin/bash
str="`xsel`"
while true ; do
a="`xsel`"
if [ "$a" != "$str" ] ; then
str="$a"
[ ${#a} -lt 15 ] && word=`w3m -dump -no-cookie http://dict.cn/mini.php?q="$a" | sed -e '$d' -e 's/</ /g' -e 's/>/ /g'`
gnome-osd-client -f "<message id='word' osd_fake_translucent_bg='off' osd_vposition='top' osd_halignment='right' animations='on' hide_timeout='10000'><span size='15000' foreground='pink'>`echo "$word"`</span></message>"
fi
sleep 1
done
gtk底下自带全局剪切板的哩xiooli 写了:kingpin 写了:支持,能鼠标取词就好了!来自solcomo,小改了下。代码: 全选
#!/bin/bash str="`xsel`" while true ; do a="`xsel`" if [ "$a" != "$str" ] ; then str="$a" [ ${#a} -lt 15 ] && word=`w3m -dump -no-cookie http://dict.cn/mini.php?q="$a" | sed -e '$d' -e 's/</ /g' -e 's/>/ /g'` gnome-osd-client -f "<message id='word' osd_fake_translucent_bg='off' osd_vposition='top' osd_halignment='right' animations='on' hide_timeout='10000'><span size='15000' foreground='pink'>`echo "$word"`</span></message>" fi sleep 1 done
嘛意思?kofshower 写了:gtk底下自带全局剪切板的哩xiooli 写了:kingpin 写了:支持,能鼠标取词就好了!来自solcomo,小改了下。代码: 全选
#!/bin/bash str="`xsel`" while true ; do a="`xsel`" if [ "$a" != "$str" ] ; then str="$a" [ ${#a} -lt 15 ] && word=`w3m -dump -no-cookie http://dict.cn/mini.php?q="$a" | sed -e '$d' -e 's/</ /g' -e 's/>/ /g'` gnome-osd-client -f "<message id='word' osd_fake_translucent_bg='off' osd_vposition='top' osd_halignment='right' animations='on' hide_timeout='10000'><span size='15000' foreground='pink'>`echo "$word"`</span></message>" fi sleep 1 done
gtk里面的primary剪切版更好用,这个程序是c写的嘛,不用依赖第三方的xselxiooli 写了:嘛意思?kofshower 写了:gtk底下自带全局剪切板的哩xiooli 写了:kingpin 写了:支持,能鼠标取词就好了!来自solcomo,小改了下。代码: 全选
#!/bin/bash str="`xsel`" while true ; do a="`xsel`" if [ "$a" != "$str" ] ; then str="$a" [ ${#a} -lt 15 ] && word=`w3m -dump -no-cookie http://dict.cn/mini.php?q="$a" | sed -e '$d' -e 's/</ /g' -e 's/>/ /g'` gnome-osd-client -f "<message id='word' osd_fake_translucent_bg='off' osd_vposition='top' osd_halignment='right' animations='on' hide_timeout='10000'><span size='15000' foreground='pink'>`echo "$word"`</span></message>" fi sleep 1 done
没搞明白咋用kofshower 写了: gtk里面的primary剪切版更好用,这个程序是c写的嘛,不用依赖第三方的xsel
x带这个更强大,可以剪切内容转移
http://www.yuanma.org/data/2006/0922/article_1575.htm 这儿有xiooli 写了:没搞明白咋用kofshower 写了: gtk里面的primary剪切版更好用,这个程序是c写的嘛,不用依赖第三方的xsel
x带这个更强大,可以剪切内容转移,没有这个命令啊。
晕乎哉,这么麻烦,俺是脚本党来的,还是xsel简单哦kofshower 写了:http://www.yuanma.org/data/2006/0922/article_1575.htm 这儿有xiooli 写了:没搞明白咋用kofshower 写了: gtk里面的primary剪切版更好用,这个程序是c写的嘛,不用依赖第三方的xsel
x带这个更强大,可以剪切内容转移,没有这个命令啊。
详细的看官方手册,现在python还有ruby都有相应的gtk+绑定,实现这种操作比shell脚本更好理解
总体来说linux这个方面比windows简单不少