Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[pull] master from slgobinath:master #87

Merged
merged 4 commits into from
Jun 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 5 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -120,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 @@ -136,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
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
Loading