All Projects → bianjp → Popup Dict

bianjp / Popup Dict

Licence: mit
Linux 下的划词翻译小工具

Programming Languages

python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to Popup Dict

Dict
Chinese and English translation tools in the command line(命令行下中英文翻译工具)
Stars: ✭ 243 (+252.17%)
Mutual labels:  dict, youdao
Eazydict
简单易用的命令行词典 📕 📙 📗 📘 📓
Stars: ✭ 92 (+33.33%)
Mutual labels:  dict, youdao
Chrome Extensions Youdaowithwordnode
有道词典chrome划词插件,原版不带生词本,在其源码基础上,添加了添加生词本的功能,生词本用的有道官方API
Stars: ✭ 74 (+7.25%)
Mutual labels:  dict, youdao
Ydict
Yet another command-line youdao dictionary for geeks!
Stars: ✭ 318 (+360.87%)
Mutual labels:  dict, youdao
Guitar
Git GUI Client
Stars: ✭ 1,136 (+1546.38%)
Mutual labels:  gui
Wxpython Examples
Source code examples from the ZetCode's wxPython tutorial
Stars: ✭ 60 (-13.04%)
Mutual labels:  gui
Googledriveuploadtool
A tool for Windows to upload and manage files in Google Drive. It resumes uploads in case of an error or failure. Perfect for uploading large files or if your connection is unstable.
Stars: ✭ 58 (-15.94%)
Mutual labels:  gui
Ttkwidgets
A collection of widgets for Tkinter's ttk extensions by various authors
Stars: ✭ 57 (-17.39%)
Mutual labels:  gui
Nitroshare Desktop
Network file transfer application for Windows, OS X, & Linux
Stars: ✭ 1,150 (+1566.67%)
Mutual labels:  gui
Traffic Rules Violation Detection
The System consists of two main components. Vehicle detection model and A graphical user interface (GUI)
Stars: ✭ 67 (-2.9%)
Mutual labels:  gui
Qtools
QTools collection of open source tools for embedded systems development on Windows, Linux and MacOS
Stars: ✭ 64 (-7.25%)
Mutual labels:  gui
Customui
Library to create custom UI's in MCPE 1.2+
Stars: ✭ 60 (-13.04%)
Mutual labels:  gui
Trifusion
Streamlining phylogenomic data gathering, processing and visualization
Stars: ✭ 65 (-5.8%)
Mutual labels:  gui
Nativefiledialog
A tiny, neat C library that portably invokes native file open and save dialogs.
Stars: ✭ 1,100 (+1494.2%)
Mutual labels:  gui
Java Mvc Swing Monopoly
模仿大富翁游戏,使用Java Swing (GUI) 实现的单机游戏,遵循MVC设计模式。Created in Java. Using GUI developed with Swing, with a MVC design pattern.
Stars: ✭ 67 (-2.9%)
Mutual labels:  gui
Nana Demo
demos and tests for Nana C++ GUI library
Stars: ✭ 57 (-17.39%)
Mutual labels:  gui
Guidefate
GUI Design From A Text Editor
Stars: ✭ 64 (-7.25%)
Mutual labels:  gui
Dictfier
Python library to convert/serialize class instances(Objects) both flat and nested into a dictionary data structure. It's very useful in converting Python Objects into JSON format
Stars: ✭ 67 (-2.9%)
Mutual labels:  dict
Gimu
Cross-platform GUI for go is never this easy and clean.
Stars: ✭ 64 (-7.25%)
Mutual labels:  gui
Awtk Linux Fb
awtk port for linux framebuffer
Stars: ✭ 61 (-11.59%)
Mutual labels:  gui

popup-dict

Linux 下的划词翻译工具,支持使用有道等多种翻译服务。

使用 Python 3 + Gtk+ 3 编写,适用于 Gnome 桌面环境。

screenshots

功能特点:

  • 目前只支持英文->中文翻译,支持单词和短语
  • 主要针对 Gnome 桌面环境,不保证其它环境下的正常使用
  • 鼠标划词翻译,弹窗显示
  • 智能处理选中内容(去除两端非英文字符、压缩空白字符、删除换行符等)
  • 弹窗显示一段时间后自动关闭。若鼠标在弹窗中,延迟关闭
  • 点击弹窗中链接可打开有道词典网页版

本工具主要受 @idningyoudao-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]

Todo

  • 实现有道词典网页版查询客户端
  • 根据选中文本位置而非鼠标位置定位弹窗(应对不用鼠标选中文本的情况;避免遮盖选中文本)
  • 支持 Wayland
  • 支持多显示器
  • 展示某些错误提示(比如 API 授权错误)
  • test
  • 进程退出时删除 pid 文件
  • 打包到 AUR
  • 版本更新提示
  • 实现 status, start, stop, restart 命令
  • 解决偶现的弹窗中列表显示异常
  • 选中内容在连字符("-")处换行时,区分是一个单词被断开还是本来就包含连字符的合成词
  • 生词本

类似工具

GUI:

Console:

License

This project is licensed under the terms of the MIT license.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].