Linux 下的划词翻译小工具
Linux 下的划词翻译工具,支持使用有道等多种翻译服务。
使用 Python 3 + Gtk+ 3 编写,适用于 Gnome 桌面环境。
功能特点:
本工具主要受 @idning 的 youdao-dict-for-ubuntu 启发。
确保已安装 PyGObject
PyPI:
sudo pip install popupdict
popup-dict
# 查看帮助
popup-dict -h
可使用 Gnome Shell Extension popup-dict-switcher 一键打开/关闭 popup-dict
应用默认加载以下位置中第一个存在的配置文件:
~/.config/popup-dict/config.ini
/etc/popup-dict/config.ini
也可通过命令参数指定配置文件位置。
注意:有道智云 API 是付费的,请自行注册账号、创建应用并配置 app_id, app_secret。参考官方文档
默认配置:
[global]
# 弹窗显示时间。单位:秒;类型:float
popup_timeout = 3
# 是否使用 Gtk Global Dark Theme。不设置或设为空则使用系统默认设置。类型: boolean
prefer_dark_theme =
# 调试模式
debug = false
# 缓存翻译结果和音频文件
cache = true
# 最大缓存条目数,仅针对单个查询客户端或发音下载器
max_cache_items = 1000
# 查询客户端配置
[query]
# 查询客户端 id
client = youdao-zhiyun
# 发音配置
[speech]
# 启用发音
enabled = true
# 自动播放
auto_play = true
# 发音客户端 id
client = youdao
# 各查询客户端的默认配置,可在各客户端的配置中覆盖
[query-client]
# 请求超时时间。单位:秒;类型:float
request_timeout = 3
# 各发音下载器的默认配置
[speech-client]
request_timeout = 5
##### 各查询客户端配置 ######
# 有道词典网页版
[query:youdao-web]
# 有道智云
# http://ai.youdao.com/doc.s#guide
[query:youdao-zhiyun]
app_id =
app_secret =
##### 各发音客户端配置 ######
[speech:youdao]
GUI:
Console:
This project is licensed under the terms of the MIT license.