Skip to content

Commit

Permalink
Merge pull request #584 from slgobinath/master
Browse files Browse the repository at this point in the history
Release Safe Eyes 2.1.9
  • Loading branch information
slgobinath authored Jun 19, 2024
2 parents 5cd9b8a + d435990 commit cca84ac
Show file tree
Hide file tree
Showing 8 changed files with 23 additions and 49 deletions.
12 changes: 0 additions & 12 deletions .github/FUNDING.yml

This file was deleted.

20 changes: 6 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
[![Flathub](https://img.shields.io/flathub/v/io.github.slgobinath.SafeEyes)](https://flathub.org/apps/details/io.github.slgobinath.SafeEyes)
[![Translation status](https://hosted.weblate.org/widgets/safe-eyes/-/translations/svg-badge.svg)](https://hosted.weblate.org/engage/safe-eyes/?utm_source=widget)
[![Awesome Humane Tech](https://raw.githubusercontent.com/humanetech-community/awesome-humane-tech/main/humane-tech-badge.svg?sanitize=true)](https://github.com/humanetech-community/awesome-humane-tech)
[![Donate](https://img.shields.io/badge/Donate-PayPal-green.svg)](https://paypal.me/slgobinath)

Protect your eyes from eye strain using this simple and beautiful, yet extensible break reminder.

Expand Down Expand Up @@ -41,7 +40,7 @@ Safe Eyes is available in Ubuntu PPA, Arch AUR, Gentoo and Python PyPI. You can
### Ubuntu, Linux Mint and other Ubuntu Derivatives

```bash
sudo add-apt-repository ppa:slgobinath/safeeyes
sudo add-apt-repository ppa:safeeyes-team/safeeyes
sudo apt update
sudo apt install safeeyes
```
Expand Down Expand Up @@ -121,11 +120,11 @@ python3 -m safeeyes
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.


### Install in Virtual Environment
### Install in a virtual environment

Some Linux systems like Cent OS do not have matching dependencies available in their repository. In such systems, you can install and use Safe Eyes in a Python Virtual Environment. The following instruction was tested on Cent OS 7.
Some Linux systems like CentOS do not have matching dependencies available in their repository. In such systems, you can install and use Safe Eyes in a Python virtual environment.

1. Install the necessary dependencies
1. Install the necessary dependencies for CentOS 7

```bash
sudo yum install python3-devel dbus dbus-devel cairo cairo-devel cairomm-devel libjpeg-turbo-devel pango pango-devel pangomm pangomm-devel gobject-introspection-devel cairo-gobject-devel
Expand All @@ -137,13 +136,12 @@ Some Linux systems like Cent OS do not have matching dependencies available in t
mkdir ~/safeeyes
cd ~/safeeyes/
pip3 install virtualenv --user
virtualenv --no-site-packages venv
python3 -m venv venv
source venv/bin/activate
pip3 install dbus-python safeeyes
```

3. Start Safe Eyes from terminal
3. Start Safe Eyes from the terminal

```bash
cd ~/safeeyes & source venv/bin/activate
Expand Down Expand Up @@ -187,9 +185,3 @@ Thirdparty plugins are available at another GitHub repository: [safeeyes-plugins
## License

GNU General Public License v3

## IDE Support

<p align="center">Thanks to JetBrains for offering IDE support to develop this Open Source project.</p>

<p align="center"><a href="https://www.jetbrains.com/?from=SafeEyes"><img src="https://raw.githubusercontent.com/JetBrains/logos/master/web/jetbrains/jetbrains.svg?sanitize=true" width="64" align="center"></a></p>
6 changes: 6 additions & 0 deletions debian/changelog
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
safeeyes (2.1.9) noble; urgency=medium

* Fix crash in smartpause

-- Gobinath Loganathan <[email protected]> Tue, 18 Jun 2024 20:25:00 -0400

safeeyes (2.1.8) noble; urgency=medium

* Support Python 3.12
Expand Down
2 changes: 1 addition & 1 deletion safeeyes/glade/about_dialog.glade
Original file line number Diff line number Diff line change
Expand Up @@ -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.8</property>
<property name="label" translatable="yes">Safe Eyes 2.1.9</property>
<property name="justify">center</property>
<attributes>
<attribute name="style" value="normal"/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
<url type="homepage">https://slgobinath.github.io/SafeEyes/</url>

<releases>
<release version="2.1.8" date="2023-06-04" />
<release version="2.1.9" date="2023-06-04" />
</releases>

<content_rating type="oars-1.1" />
Expand Down
6 changes: 3 additions & 3 deletions safeeyes/safeeyes.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
gi.require_version('Gtk', '3.0')
from gi.repository import Gtk

SAFE_EYES_VERSION = "2.1.8"
SAFE_EYES_VERSION = "2.1.9"


class SafeEyes:
Expand Down Expand Up @@ -71,8 +71,8 @@ def __init__(self, system_locale, config):
self.show_about)
self.context['api']['enable_safeeyes'] = lambda next_break_time=-1, reset_breaks=False: \
utility.execute_main_thread(self.enable_safeeyes, next_break_time, reset_breaks)
self.context['api']['disable_safeeyes'] = lambda status: utility.execute_main_thread(
self.disable_safeeyes, status)
self.context['api']['disable_safeeyes'] = lambda status=None, is_resting=False: utility.execute_main_thread(
self.disable_safeeyes, status, is_resting)
self.context['api']['status'] = self.status
self.context['api']['quit'] = lambda: utility.execute_main_thread(
self.quit)
Expand Down
20 changes: 4 additions & 16 deletions safeeyes/utility.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,28 +94,16 @@ def start_thread(target_function, **args):
thread.start()


# def execute_main_thread(target_function, args=None):
# def execute_main_thread(target_function, *args, **kwargs):
# """
# Execute the given function in main thread.
# Execute the given function in main thread, forwarding positional and keyword arguments.
# """
# if args:
# GLib.idle_add(lambda: target_function(args))
# else:
# GLib.idle_add(target_function)

def execute_main_thread(target_function, arg1=None, arg2=None):
def execute_main_thread(target_function, *args, **kwargs):
"""
Execute the given function in main thread.
"""
if arg1 is not None and arg2 is not None:
GLib.idle_add(lambda: target_function(arg1, arg2))
elif arg1 is not None:
GLib.idle_add(lambda: target_function(arg1))
elif arg2 is not None:
GLib.idle_add(lambda: target_function(arg2))
else:
GLib.idle_add(target_function)

GLib.idle_add(lambda: target_function(*args, **kwargs))

def system_locale(category=locale.LC_MESSAGES):
"""
Expand Down
4 changes: 2 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,14 +78,14 @@ def __package_data():

setuptools.setup(
name="safeeyes",
version="2.1.8",
version="2.1.9",
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="[email protected]",
url="https://github.com/slgobinath/SafeEyes",
download_url="https://github.com/slgobinath/SafeEyes/archive/v2.1.8.tar.gz",
download_url="https://github.com/slgobinath/SafeEyes/archive/v2.1.9.tar.gz",
packages=setuptools.find_packages(),
package_data={'safeeyes': __package_data()},
data_files=__data_files(),
Expand Down

0 comments on commit cca84ac

Please sign in to comment.