GithubHelp home page GithubHelp logo

popup-dict's Introduction

popup-dict

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

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

功能特点:

  • 目前只支持英文->中文翻译
  • 主要针对 Gnome 桌面环境,不保证其它环境下的正常使用
  • 鼠标划词翻译,弹窗显示
  • 弹窗显示一段时间后自动关闭。若鼠标在弹窗中,延迟关闭
  • 点击弹窗中链接可打开有道词典网页版

本工具主要受 @idningyoudao-dict-for-ubuntu 启发。

依赖

安装

安装 PyGObject

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

也可通过命令参数指定配置文件位置。

默认配置:

[global]
# 查询客户端
query_client = youdao-zhiyun
# 弹窗显示时间。单位:秒;类型:float
popup_timeout = 3
# 是否使用 Gtk Global Dark Theme。不设置或设为空则使用系统默认设置。类型: boolean
prefer_dark_theme=

# 适用于所有客户端的默认设置,可在各客户端的配置中覆盖
[client]
# 请求超时时间。单位:秒;类型:float
request_timeout = 3


##### 各客户端配置 ######

# 有道词典网页版
[youdao-web]

# 有道智云
# http://ai.youdao.com/doc.s#guide
[youdao-zhiyun]
app_id =
app_secret =

Todo

  • 弹窗显示时自动发音
  • 点击音标发音
  • 根据选中文本位置而非鼠标位置定位弹窗(应对不用鼠标选中文本的情况;避免遮盖选中文本)
  • 多显示器支持
  • debug 模式
  • 缓存查询结果
  • 展示某些错误提示(比如 API 授权错误)
  • logging
  • test
  • 进程退出时删除 pid 文件
  • 打包到 AUR

类似工具

GUI:

Console:

参考资料

License

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

popup-dict's People

Contributors

bianjp avatar

Watchers

Yi Xianfu avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.