Merge pull request #501 from slgobinath/master

Release 2.1.5
This commit is contained in:
Gobinath 2023-01-05 19:15:48 -05:00 committed by GitHub
commit e495bf5652
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 87 additions and 13 deletions

67
.github/workflows/release.yml vendored Normal file
View File

@ -0,0 +1,67 @@
name: Release
on:
push:
branches: [ release ]
jobs:
release:
name: Release
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
token: ${{ secrets.GH_API_SECRET }}
- name: Set up Python 3.10
uses: actions/setup-python@v3
with:
python-version: "3.10"
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install build
- name: Get Current Version
run: |
project_version=$(python3 setup.py --version)
echo "project_version=$project_version" >> $GITHUB_OUTPUT
id: get_current_version
- name: Create Tag
uses: mathieudutour/github-tag-action@v6.1
with:
custom_tag: "v${{steps.get_current_version.outputs.project_version}}"
github_token: ${{ secrets.GH_API_SECRET }}
- name: Build Changelog
id: build_changelog
uses: mikepenz/release-changelog-builder-action@v3.4.0
env:
GITHUB_TOKEN: ${{ secrets.GH_API_SECRET }}
- name: Create Release
uses: softprops/action-gh-release@v1
with:
tag_name: 'v${{steps.get_current_version.outputs.project_version}}'
body: ${{steps.build_changelog.outputs.changelog}}
token: ${{ secrets.GH_API_SECRET }}
- name: Build Python Package
run: rm -Rf build *.egg-info/ && python3 setup.py sdist bdist_wheel
- name: Publish to PyPi
uses: pypa/gh-action-pypi-publish@v1.6.4
with:
password: ${{ secrets.PYPI_API_TOKEN }}
- name: Sync Release with Master
run: |
git fetch origin
git checkout release
git pull origin release
git checkout master
git pull origin master
git merge release --ff-only
git push origin master

2
debian/changelog vendored
View File

@ -1,4 +1,4 @@
safeeyes (2.1.4-3) lunar; urgency=high
safeeyes (2.1.5-0) lunar; urgency=high
* Minor bug fixes
* Fix the ecd ..rror if there is no long break

View File

@ -71,7 +71,7 @@ along with this program. If not, see &lt;https://www.gnu.org/licenses/&gt;.</pr
<property name="valign">center</property>
<property name="margin_top">10</property>
<property name="margin_bottom">10</property>
<property name="label" translatable="yes">Safe Eyes 2.1.4</property>
<property name="label" translatable="yes">Safe Eyes 2.1.5</property>
<property name="justify">center</property>
<attributes>
<attribute name="style" value="normal"/>

View File

@ -80,16 +80,15 @@ def is_active_window_skipped_xorg(pre_break):
# Extract the process name
process_names = re.findall('"(.+?)"', stdout)
if process_names:
process = process_names[1].lower()
if process in skip_break_window_classes:
process_name = process_names[1].lower()
if _window_class_matches(process_name, skip_break_window_classes):
return True
elif process in take_break_window_classes:
elif _window_class_matches(process_name, take_break_window_classes):
if is_fullscreen and unfullscreen_allowed and not pre_break:
try:
active_window.unfullscreen()
except BaseException:
logging.error(
'Error in unfullscreen the window ' + process)
except BaseException as e:
logging.error('Error in unfullscreen the window ' + process_name, exc_info=e)
return False
return is_fullscreen
@ -97,6 +96,10 @@ def is_active_window_skipped_xorg(pre_break):
return False
def _window_class_matches(window_class: str, classes: list) -> bool:
return any(map(lambda w: w in classes, window_class.split()))
def is_on_battery():
"""
Check if the computer is running on battery.
@ -131,12 +134,16 @@ def init(ctx, safeeyes_config, plugin_config):
global dnd_while_on_battery
logging.debug('Initialize Skip Fullscreen plugin')
context = ctx
skip_break_window_classes = plugin_config['skip_break_windows'].split()
take_break_window_classes = plugin_config['take_break_windows'].split()
skip_break_window_classes = _normalize_window_classes(plugin_config['skip_break_windows'])
take_break_window_classes = _normalize_window_classes(plugin_config['take_break_windows'])
unfullscreen_allowed = plugin_config['unfullscreen']
dnd_while_on_battery = plugin_config['while_on_battery']
def _normalize_window_classes(classes_as_str: str):
return [w.lower() for w in classes_as_str.split()]
def on_pre_break(break_obj):
"""
Lifecycle method executes before the pre-break period.

View File

@ -40,7 +40,7 @@ from safeeyes.ui.settings_dialog import SettingsDialog
gi.require_version('Gtk', '3.0')
from gi.repository import Gtk
SAFE_EYES_VERSION = "2.1.4"
SAFE_EYES_VERSION = "2.1.5"
class SafeEyes:

View File

@ -78,14 +78,14 @@ def __package_data():
setuptools.setup(
name="safeeyes",
version="2.1.4",
version="2.1.5",
description="Protect your eyes from eye strain using this continuous breaks reminder.",
long_description=long_description,
long_description_content_type="text/markdown",
author="Gobinath Loganathan",
author_email="slgobinath@gmail.com",
url="https://github.com/slgobinath/SafeEyes",
download_url="https://github.com/slgobinath/SafeEyes/archive/v2.1.4.tar.gz",
download_url="https://github.com/slgobinath/SafeEyes/archive/v2.1.5.tar.gz",
packages=setuptools.find_packages(),
package_data={'safeeyes': __package_data()},
data_files=__data_files(),