Skip to content

TokinoyuushaLink/BarDict

Repository files navigation

BarDict 未命名

macOS菜单栏mdx/mdd查词app

截屏2026-05-26 下午8 25 52 截屏2026-05-26 下午8 26 10 截屏2026-05-26 下午8 26 18

特性:

  • 简洁友好,使用WKWebView进行渲染
  • 动态高度缩放,带有些许动画
  • 支持现有MDict2.x,1.x,lzo压缩格式的mdx
  • 支持全局快捷键打开,目前有shift+space和option+space
  • 允许多词典命中,多词典切换
  • 允许通过数控板切换视图

*中文学习者推荐使用新世纪英汉词典

操作:

  • 点击菜单栏图标/全局快捷键打开菜单栏app
  • 输入单词
  • tab/shift+tab 或 ↑ / ↓ 键进行候选切换
  • Enter输入
  • Esc从详细视图切回/关闭菜单窗口

编译:

  1. 首先,你需要Command-Line-Tool,uv
  2. Bash
    chmod +x build.sh
    ./build.sh
    

构建SQLite数据库:

  1. 在代码栏里找到mdx2db.py
  2. Bash
    uv run mdx2db.py 你的词典文件.mdx
    
  3. 构建的数据库会自动放入~/Library/Application Support/BarDict/中,如果路径不存在请手动创建

Features:

  • Clean and friendly UI, rendered with WKWebView
  • Dynamic height scaling with subtle animation
  • Supports existing MDict 2.x, 1.x, and lzo-compressed MDX formats
  • Global hotkey support (currently Shift+Space and Option+Space)
  • Supports multiple dictionary matches and switching between them
  • Allow using Trackpad gesture to navigate views

Usage:

  • Click the menu bar icon / use global hotkey to open the menu bar app
  • Enter a word
  • Use Tab / Shift+Tab or ↑ / ↓ keys to cycle through candidates
  • Press Enter to confirm
  • Press Esc to return from detailed view / close the menu window

Build Instructions:

  1. First, install Command Line Tools and uv
  2. Run:
    chmod +x build.sh  
    ./build.sh  
    

Building SQLite Database:

  1. Locate mdx2db.py in the code
  2. Run:
    uv run mdx2db.py YourOwnMdxFile.mdx  
    
  3. The generated database will be automatically placed in ~/Library/Application Support/BarDict/ — create the path manually if it doesn't exist