| 页面 | 截图 | 说明 |
|---|---|---|
| 专注 | MacOS: Ubuntu: Windows: ![]() |
|
| 统计 | ![]() |
|
| 统计(年) | ![]() |
|
| 设置 | ![]() |
|
| 管理专注类型 | ![]() |
|
| 状态栏(MacOS 倒计时) | ![]() |
可从 github release 页面下载对应的安装包进行安装, 或自行 打包
在 zip 格式的压缩包内, 直接运行 TomatoClock.exe 文件即可
在 zip 格式的压缩包内, 直接运行 TomatoClock.app 文件即可
对于 Ubuntu 22.04 或更高版本, 通常执行 TomatoClock 文件即可, 目前并没有制作启动器文件, 以下是可能会遇到的报错:
~/Downloads/dist/TomatoClock/TomatoClock
qt.qpa.plugin: From 6.5.0, xcb-cursor0 or libxcb-cursor0 is needed to load the Qt xcb platform plugin.
qt.qpa.plugin: Could not load the Qt platform plugin "xcb" in "" even though it was found.
This application failed to start because no Qt platform plugin could be initialized. Reinstalling the application may fix this problem.
Available platform plugins are: wayland-brcm, wayland-egl, wayland, xcb, vnc, eglfs, minimal, minimalegl, offscreen, vkkhrdisplay, linuxfb.
Aborted直接更新并安装缺少的依赖, 例如此处是 libxcb-cursor0:
sudo apt-add-repository universe
sudo apt update
sudo apt install -y libxcb-cursor0# 安装依赖
uv sync
uv pip install -e .
# 运行应用(或点击 `src/main.py` 的 `Run Python File` 按钮)
uv run src/main.py静态资源文件必须使用 Qt Resource System 管理, 当资源文件更新时:
- 将静态资源文件(图片 / 视频) 放到
src/assets目录下 - 打开
resources.qrc文件, 添加资源文件 - 运行
rcc -g python resources.qrc -o src/assets/reources_rc.py生成src/assets/reources_rc.py文件 - 在
src/main.py中通过from src.assets import reources_rc引入(现在已经引入了)
rcc 命令来自 qt 工具链, 不包含在 PyQt6 包中
本项目基于 Github Actions 工作流, 只需提交 tag 即可自动打包
git tag add v1.0.5 && git push origin v1.0.5# 对于 MacOS:
uv run pyinstaller \
--name TomatoClock \
--windowed \
--clean \
--noconfirm \
--add-data "pyproject.toml:." \
--icon icon.icns \
src/main.py
# 对于 Windows:
uv run pyinstaller \
--name TomatoClock \
--windowed \
--clean \
--noconfirm \
--add-data "pyproject.toml;." \
--icon icon.ico \
src/main.py# [MacOS] 打开应用, 或直接在 finder 中双击运行
./dist/TomatoClock.app/Contents/MacOS/TomatoClock本项目使用 Github Actions 进行构建, 具体构建命令在 github/workflows/release.yml 中
对于 MacOS 需要生成 icon.iconset:
mkdir icon.iconset
sips -z 16 16 src/assets/app-icon-256.png -o icon.iconset/icon_16x16.png
sips -z 32 32 src/assets/app-icon-256.png -o icon.iconset/icon_32x32.png
sips -z 128 128 src/assets/app-icon-256.png -o icon.iconset/icon_128x128.png
sips -z 256 256 src/assets/app-icon-256.png -o icon.iconset/icon_256x256.png
sips -z 512 512 src/assets/app-icon-512.png -o icon.iconset/icon_512x512.png
iconutil -c icns icon.iconset对于 Windows 需要生成 icon.ico:
# uv add --dev pillow
uv run python -c "from PIL import Image; img = Image.open('src/assets/app-icon-512.
png'); img.save('icon.ico', format='ICO', sizes=[(16,16), (32,32), (48,48), (64,64), (128,128), (256,256)])"






