Skip to main content

mysphinx-snip

一个用 Python + PySide6 实现的跨平台桌面截图工具。

功能(v0.0.1)

  • 区域截图:拖拽框选屏幕区域,支持框选后移动 / 缩放(八个手柄)。
  • 标注工具:矩形、椭圆、箭头、画笔、文字、马赛克、高亮、序号,支持 撤销 / 重做(Ctrl+Z / Ctrl+Y),可调颜色与线宽。
  • 输出:复制到剪贴板、保存为 PNG/JPEG(自动按时间戳命名)。
  • 贴图:把截图钉在屏幕最上层的悬浮窗,可拖动、滚轮缩放、右键菜单 (复制 / 保存 / 不透明度 / 关闭)。
  • 系统托盘 + 全局热键:默认 Ctrl+Shift+A(macOS 为 Cmd+Shift+A)。
  • 多显示器 / HiDPI:每块屏幕一个覆盖层,按 device-pixel-ratio 输出物理像素。

暂未实现(后续迭代):长截图、录屏(MP4/GIF)、带壳截图、OCR/AI、截图历史回溯。

安装

pip install -e .          # 或者:pip install -r requirements.txt

运行

mysphinx-snip             # 安装后提供的命令
# 或
python -m snip

启动后程序常驻系统托盘。点击托盘图标或按全局热键即可开始截图。

截图操作

  1. 触发后屏幕变暗,拖拽框选要截取的区域。
  2. 选区下方出现工具条:选择标注工具进行标注(未选工具时可移动/缩放选区)。
  3. 点击 复制 / 保存 / 贴图,或按 Enter 复制、Esc 取消。

平台说明

  • macOS:需要在 系统设置 → 隐私与安全性 授予两类权限:
    • 屏幕录制(必需):否则截到的图只有壁纸、没有窗口内容。首次运行会自动弹出授权请求。
    • 辅助功能(仅全局热键需要):否则会看到 This process is not trusted! ... 且 Cmd+Shift+A 无效。 权限要授给运行本程序的那个应用——从终端启动就是 Terminal/iTerm(打包成 .app 后则是该 App)。 授权后必须完全退出并重启该终端/App 才会生效。

      提示:即使没开热键,也可以直接点菜单栏图标 →「截图」 使用;菜单里的 「权限设置…」可一键打开对应的系统设置面板。 已知限制:覆盖层无法盖住系统菜单栏区域(普通窗口层级限制),不影响其余区域截图。

  • Windows:进程默认开启 Per-Monitor v2 DPI 感知,HiDPI 下输出清晰。
  • Linux:X11 下可用;Wayland 对全屏覆盖层与全局热键支持有限(非主要目标平台)。

开发

pip install -e ".[dev]"
QT_QPA_PLATFORM=offscreen pytest      # 标注模型与逻辑层单测,无需真实显示

项目结构

snip/
  app.py          # 入口:系统托盘、全局热键、截图流程编排
  capture.py      # 屏幕抓取(QScreen.grabWindow → QPixmap,多屏 / HiDPI)
  overlay.py      # 全屏选区覆盖层 + 实时标注交互
  toolbar.py      # 选区浮动工具条
  annotations.py  # 标注数据模型 + 渲染 + 撤销/重做(纯逻辑,可单测)
  pin.py          # 贴图悬浮窗
  config.py       # 配置(QSettings)

Metadata

Release files for mysphinx-snip 0.0.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for mysphinx-snip 0.0.1
File Size Uploaded Provenance Actions
mysphinx_snip-0.0.1.tar.gz 22.9 kB Without provenance Details for mysphinx_snip-0.0.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for mysphinx-snip 0.0.1
File Interpreter ABI Platform Actions
mysphinx_snip-0.0.1-py3-none-any.whl Python 3 none any Details for mysphinx_snip-0.0.1-py3-none-any.whl

Total release size: 47.6 kB

Release files / mysphinx_snip-0.0.1.tar.gz

Download URL mysphinx_snip-0.0.1.tar.gz
Size 22.9 kB
Tags Source
SHA-256 checksum
How to use checksums
b74c9ec5bb2c846c65509d0fb1cbb40286b3811647b4cb427a6714f0c3a5ed06
BLAKE2b-256 checksum
How to use checksums
d633e4b9268f11b4ee7ef23a82b2b1021c941e834060b5f6bd2335bb22a65e58
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.12.12

Release files / mysphinx_snip-0.0.1-py3-none-any.whl

Download URL mysphinx_snip-0.0.1-py3-none-any.whl
Size 24.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
3d320d4387463fa8b44a662e8c5eb8fa1135e063bcb4f17de04e7cf5f07e2647
BLAKE2b-256 checksum
How to use checksums
72e2613e8631dbf8c890cb5fb6e3cd001db21a1f228a98e9913d40980ca368c4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.12.12

Security for mysphinx-snip 0.0.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.0.1 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page