commit
e495bf5652
|
@ -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
|
|
@ -1,4 +1,4 @@
|
||||||
safeeyes (2.1.4-3) lunar; urgency=high
|
safeeyes (2.1.5-0) lunar; urgency=high
|
||||||
* Minor bug fixes
|
* Minor bug fixes
|
||||||
|
|
||||||
* Fix the ecd ..rror if there is no long break
|
* Fix the ecd ..rror if there is no long break
|
||||||
|
|
|
@ -71,7 +71,7 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.</pr
|
||||||
<property name="valign">center</property>
|
<property name="valign">center</property>
|
||||||
<property name="margin_top">10</property>
|
<property name="margin_top">10</property>
|
||||||
<property name="margin_bottom">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>
|
<property name="justify">center</property>
|
||||||
<attributes>
|
<attributes>
|
||||||
<attribute name="style" value="normal"/>
|
<attribute name="style" value="normal"/>
|
||||||
|
|
|
@ -80,16 +80,15 @@ def is_active_window_skipped_xorg(pre_break):
|
||||||
# Extract the process name
|
# Extract the process name
|
||||||
process_names = re.findall('"(.+?)"', stdout)
|
process_names = re.findall('"(.+?)"', stdout)
|
||||||
if process_names:
|
if process_names:
|
||||||
process = process_names[1].lower()
|
process_name = process_names[1].lower()
|
||||||
if process in skip_break_window_classes:
|
if _window_class_matches(process_name, skip_break_window_classes):
|
||||||
return True
|
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:
|
if is_fullscreen and unfullscreen_allowed and not pre_break:
|
||||||
try:
|
try:
|
||||||
active_window.unfullscreen()
|
active_window.unfullscreen()
|
||||||
except BaseException:
|
except BaseException as e:
|
||||||
logging.error(
|
logging.error('Error in unfullscreen the window ' + process_name, exc_info=e)
|
||||||
'Error in unfullscreen the window ' + process)
|
|
||||||
return False
|
return False
|
||||||
|
|
||||||
return is_fullscreen
|
return is_fullscreen
|
||||||
|
@ -97,6 +96,10 @@ def is_active_window_skipped_xorg(pre_break):
|
||||||
return False
|
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():
|
def is_on_battery():
|
||||||
"""
|
"""
|
||||||
Check if the computer is running 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
|
global dnd_while_on_battery
|
||||||
logging.debug('Initialize Skip Fullscreen plugin')
|
logging.debug('Initialize Skip Fullscreen plugin')
|
||||||
context = ctx
|
context = ctx
|
||||||
skip_break_window_classes = plugin_config['skip_break_windows'].split()
|
skip_break_window_classes = _normalize_window_classes(plugin_config['skip_break_windows'])
|
||||||
take_break_window_classes = plugin_config['take_break_windows'].split()
|
take_break_window_classes = _normalize_window_classes(plugin_config['take_break_windows'])
|
||||||
unfullscreen_allowed = plugin_config['unfullscreen']
|
unfullscreen_allowed = plugin_config['unfullscreen']
|
||||||
dnd_while_on_battery = plugin_config['while_on_battery']
|
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):
|
def on_pre_break(break_obj):
|
||||||
"""
|
"""
|
||||||
Lifecycle method executes before the pre-break period.
|
Lifecycle method executes before the pre-break period.
|
||||||
|
|
|
@ -40,7 +40,7 @@ from safeeyes.ui.settings_dialog import SettingsDialog
|
||||||
gi.require_version('Gtk', '3.0')
|
gi.require_version('Gtk', '3.0')
|
||||||
from gi.repository import Gtk
|
from gi.repository import Gtk
|
||||||
|
|
||||||
SAFE_EYES_VERSION = "2.1.4"
|
SAFE_EYES_VERSION = "2.1.5"
|
||||||
|
|
||||||
|
|
||||||
class SafeEyes:
|
class SafeEyes:
|
||||||
|
|
4
setup.py
4
setup.py
|
@ -78,14 +78,14 @@ def __package_data():
|
||||||
|
|
||||||
setuptools.setup(
|
setuptools.setup(
|
||||||
name="safeeyes",
|
name="safeeyes",
|
||||||
version="2.1.4",
|
version="2.1.5",
|
||||||
description="Protect your eyes from eye strain using this continuous breaks reminder.",
|
description="Protect your eyes from eye strain using this continuous breaks reminder.",
|
||||||
long_description=long_description,
|
long_description=long_description,
|
||||||
long_description_content_type="text/markdown",
|
long_description_content_type="text/markdown",
|
||||||
author="Gobinath Loganathan",
|
author="Gobinath Loganathan",
|
||||||
author_email="slgobinath@gmail.com",
|
author_email="slgobinath@gmail.com",
|
||||||
url="https://github.com/slgobinath/SafeEyes",
|
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(),
|
packages=setuptools.find_packages(),
|
||||||
package_data={'safeeyes': __package_data()},
|
package_data={'safeeyes': __package_data()},
|
||||||
data_files=__data_files(),
|
data_files=__data_files(),
|
||||||
|
|
Loading…
Reference in New Issue