Skip to content

Commit 859fe44

Browse files
authored
Merge pull request #710 from slgobinath/master
Release v3.0.0b1 [BETA RELEASE] * Update to GTK4 * Improved Wayland support (keyboard locking, idle detection, window icons, fullscreen) * Internal refactoring (linting, formatting, typechecking on CI) * Improved handling of custom user stylesheets: always fall back to internal styles, with a lower priority * Translations
2 parents 54a2ea6 + 044701d commit 859fe44

File tree

96 files changed

+3625
-3678
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

96 files changed

+3625
-3678
lines changed

.editorconfig

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# top-most EditorConfig file
2+
root = true
3+
4+
# Unix-style newlines with a newline ending every file
5+
[*]
6+
end_of_line = lf
7+
insert_final_newline = true
8+
charset = utf-8
9+
indent_style = space
10+
indent_size = 4
11+
12+
[*.{py}]
13+
trim_trailing_whitespace = true

.git-blame-ignore-revs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
# Use `git config blame.ignorerevsfile .git-blame-ignore-revs` to make `git blame` ignore the following commits.
2+
3+
# format using ruff
4+
5bac6fe9a3b9b95abbbb364a48b5aad7c915e4ed

.github/ISSUE_TEMPLATE/bug_report.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,5 +30,8 @@ A clear and concise description of what you expected to happen.
3030
**Debug Log**
3131
Run the Safe Eyes using `safeeyes --debug` command attach the ~/safeeyes.log` file.
3232

33+
**Configuration**
34+
Attach the configuration file, usually found in `~/.config/safeeyes/safeeyes.json`.
35+
3336
**Screenshots**
3437
If applicable, add screenshots to help explain your problem.

.github/pull_request_template.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,5 @@
33
Describe your changes here, and link to related issues if available.
44

55
Reminder to run `python validate_po.py --extract` if you have added new translatable strings.
6+
7+
Reminder to run `ruff check`, `ruff format`, and `mypy safeeyes` to ensure coding standards are followed and types are correct.

.github/workflows/lint.yml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
name: Lint
2+
3+
on: [push, pull_request]
4+
5+
jobs:
6+
lint-ruff:
7+
runs-on: ubuntu-latest
8+
name: ruff
9+
steps:
10+
- name: Check out source repository
11+
uses: actions/checkout@v3
12+
- uses: astral-sh/ruff-action@v3
13+
# this runs `ruff check`
14+
- run: ruff format --check
15+
# this runs `ruff format --check`, additionally

.github/workflows/mypy.yml

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
# Workflow to run mypy
2+
# Adapted from the CPython mypy action
3+
name: mypy
4+
5+
on: [push, pull_request]
6+
7+
permissions:
8+
contents: read
9+
10+
env:
11+
UV_SYSTEM_PYTHON: 1
12+
PIP_DISABLE_PIP_VERSION_CHECK: 1
13+
FORCE_COLOR: 1
14+
TERM: xterm-256color # needed for FORCE_COLOR to work on mypy on Ubuntu, see https://github.com/python/mypy/issues/13817
15+
16+
jobs:
17+
mypy:
18+
name: mypy
19+
runs-on: ubuntu-latest
20+
steps:
21+
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
22+
with:
23+
persist-credentials: false
24+
- uses: astral-sh/setup-uv@22695119d769bdb6f7032ad67b9bca0ef8c4a174 # v5.4.0
25+
with:
26+
enable-cache: true
27+
cache-dependency-glob: ''
28+
cache-suffix: '3.13'
29+
- name: Setup Python
30+
uses: actions/setup-python@8d9ed9ac5c53483de85588cdf95a591a75ab9f55 # v5.5.0
31+
with:
32+
python-version: '3.13'
33+
- run: sudo apt-get install -y libwayland-dev libcairo2-dev libgirepository-2.0-dev
34+
- run: uv pip install -r pyproject.toml
35+
- run: uv pip install --group types
36+
- run: mypy safeeyes

.github/workflows/release.yml

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -24,15 +24,16 @@ jobs:
2424
pip install build wheel
2525
2626
- name: Get Current Version
27-
run: |
28-
project_version=$(python3 setup.py --version)
29-
echo "project_version=$project_version" >> $GITHUB_OUTPUT
27+
uses: SebRollen/[email protected]
28+
with:
29+
file: "pyproject.toml"
30+
field: project.version
3031
id: get_current_version
3132

3233
- name: Create Tag
3334
uses: mathieudutour/[email protected]
3435
with:
35-
custom_tag: "${{steps.get_current_version.outputs.project_version}}"
36+
custom_tag: "${{steps.get_current_version.outputs.value}}"
3637
github_token: ${{ secrets.GH_API_SECRET }}
3738

3839
- name: Build Changelog
@@ -44,7 +45,7 @@ jobs:
4445
- name: Create Release
4546
uses: softprops/action-gh-release@v1
4647
with:
47-
tag_name: 'v${{steps.get_current_version.outputs.project_version}}'
48+
tag_name: 'v${{steps.get_current_version.outputs.value}}'
4849
body: ${{steps.build_changelog.outputs.changelog}}
4950
token: ${{ secrets.GH_API_SECRET }}
5051

MANIFEST.in

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,6 @@
11
include LICENSES/GPL-3.0-or-later.txt
22
include README.md
3+
4+
graft safeeyes
5+
6+
global-exclude *.py[cod]

README.md

Lines changed: 24 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -79,14 +79,13 @@ sudo apt-get install safeeyes
7979
```
8080

8181
### Fedora
82-
If you want to use Smart Pause plugin, install the latest xprintidle from: [alonid/xprintidle](https://copr.fedorainfracloud.org/coprs/alonid/xprintidle/)
82+
Available on the [praiskup/safeeyes](https://copr.fedorainfracloud.org/coprs/praiskup/safeeyes/) COPR maintained by @praiksup
83+
8384
```bash
84-
sudo dnf install python3-psutil python3-packaging cairo-devel python3-devel gobject-introspection-devel cairo-gobject-devel
85-
sudo pip3 install safeeyes
86-
sudo gtk-update-icon-cache /usr/share/icons/hicolor
85+
sudo dnf -y copr enable praiskup/safeeyes
86+
sudo dnf -y install python3-safeeyes
8787
```
88-
89-
We are looking for an official package maintainer for Fedora. Please [contact us](https://github.com/slgobinath/SafeEyes/issues/611) if you are interested.
88+
For smart pause plugin, you may have to install the latest xprintidle from: [alonid/xprintidle](https://copr.fedorainfracloud.org/coprs/alonid/xprintidle/)
9089

9190
### OpenSUSE Tumbleweed
9291

@@ -101,6 +100,13 @@ sudo zypper install safeeyes
101100
sudo apk add safeeyes
102101
```
103102

103+
### Chrome OS
104+
[Enable the Linux container](https://support.google.com/chromebook/answer/9145439?hl=en) (which is actually Debian), and install Safe Eyes with
105+
```
106+
sudo apt install safeeyes
107+
```
108+
While no tray icon is available, if you run the app, it will function in the background and will show breaks as usual. You can also change the settings by clicking on the Safe Eyes icon from the menu while the app is running, or by running the command `safeeyes -s`.
109+
104110
### Flatpak
105111
**Warning**: Many plugins and features don't work well in the flatpak. We recommend that you use one of the native packages listed above. Flatpak-only bugs should be reported at https://github.com/flathub/io.github.slgobinath.SafeEyes.
106112
```bash
@@ -139,6 +145,8 @@ python3 -m safeeyes
139145

140146
Safe Eyes installers install the required icons to `/usr/share/icons/hicolor`. When you run Safe Eyes from source without, some icons may not appear.
141147

148+
Note that on Wayland, this may still not be enough to get window icons working properly, as Wayland requires the .desktop file to match the running application, which is hard to do when running from source. If at all possible, prefer using an installed package.
149+
142150

143151
### Install in a virtual environment
144152

@@ -170,6 +178,8 @@ Some Linux systems like CentOS do not have matching dependencies available in th
170178

171179
For more details, please check the issue: [#329](https://github.com/slgobinath/SafeEyes/issues/329)
172180

181+
This method has the same caveats about icons/window icons as running from source.
182+
173183
## Features
174184

175185
- Remind you to take breaks with exercises to reduce RSI
@@ -194,15 +204,20 @@ Examples for translatable strings are `_("This is a string")` in Python code, or
194204

195205
To ensure the new strings are well-formed, you can use `python validate_po.py --validate`.
196206

207+
To ensure that the coding and formatting guidelines are followed, install [ruff](https://docs.astral.sh/ruff/) and run `ruff check` and `ruff format --check` to check for issues, as well as `ruff check --fix` and `ruff format` to autofix them.
208+
209+
To ensure that any types are correct, install [mypy](https://github.com/python/mypy) and run `mypy safeeyes`.
210+
211+
The last three checks are also run in CI, so a PR must pass all the tests for it to be mmerged.
212+
197213
## How to Release?
198214

199215
0. Run `update-po.sh` to generate new translation files (which will be eventually updated by translators). Commit and push the changes to the master branch.
200216
1. Checkout the latest commits from the `master` branch
201217
2. Run `python3 -m safeeyes` to make sure nothing is broken
202218
3. Update the Safe Eyes version in the following places (Open the project in VSCode and search for the current version):
203-
- [setup.py](https://github.com/slgobinath/SafeEyes/blob/master/setup.py#L82)
204-
- [setup.py](https://github.com/slgobinath/SafeEyes/blob/master/setup.py#L89)
205-
- [safeeyes.py](https://github.com/slgobinath/SafeEyes/blob/master/safeeyes/safeeyes.py#L42)
219+
- [pyproject.toml](https://github.com/slgobinath/SafeEyes/blob/master/pyproject.toml#L4)
220+
- [pyproject.toml](https://github.com/slgobinath/SafeEyes/blob/master/pyproject.toml#L35)
206221
- [io.github.slgobinath.SafeEyes.metainfo.xml](https://github.com/slgobinath/SafeEyes/blob/master/safeeyes/platform/io.github.slgobinath.SafeEyes.metainfo.xml#L56)
207222
- [about_dialog.glade](https://github.com/slgobinath/SafeEyes/blob/master/safeeyes/glade/about_dialog.glade#L74)
208223
4. Update the [changelog](https://github.com/slgobinath/SafeEyes/blob/master/debian/changelog) (for Ubuntu PPA release)

debian/changelog

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,19 @@
1+
safeeyes (3.0.0b1) noble; urgency=medium
2+
3+
* Update to GTK4
4+
5+
* Improved Wayland support (keyboard locking, idle detection, window icons,
6+
fullscreen)
7+
8+
* Internal refactoring (linting, formatting, typechecking on CI)
9+
10+
* Improved handling of custom user stylesheets: always fall back to internal
11+
styles, with a lower priority
12+
13+
* Translations
14+
15+
-- Mel Dafert <[email protected]> Mon, 05 May 2025 11:30:00 +0000
16+
117
safeeyes (2.2.3) jammy; urgency=medium
218

319
* Translations

0 commit comments

Comments
 (0)