Coder Social home page Coder Social logo

slgobinath / safeeyes Goto Github PK

View Code? Open in Web Editor NEW
1.4K 21.0 159.0 6.37 MB

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

Home Page: http://slgobinath.github.io/SafeEyes/

License: GNU General Public License v3.0

Python 98.52% CSS 1.25% Shell 0.24%
linux utility health eye-strain safe-eyes

safeeyes's Introduction

Safe Eyes

Release PyPI version Debian AUR Flathub Translation status Awesome Humane Tech Donate

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

Visit the official site: https://slgobinath.github.io/SafeEyes/ for more details.

Safe Eyes command-line arguments

usage: safeeyes [-h] [-a | -d | -e | -q | -s | -t] [--debug] [--version]

Safe Eyes protects your eyes from eye strain (asthenopia) by reminding you to
take breaks while you're working long hours at the computer.

optional arguments:
  -h, --help        show this help message and exit
  -a, --about       show the about dialog
  -d, --disable     disable the currently running safeeyes instance
  -e, --enable      enable the currently running safeeyes instance
  -q, --quit        quit the running safeeyes instance and exit
  -s, --settings    show the settings dialog
  -t, --take-break  take a break now
  --debug           start safeeyes in debug mode
  --status          print the status of running safeeyes instance and exit
  --version         show program's version number and exit

Installation guide

Safe Eyes is available in Ubuntu PPA, Arch AUR, Gentoo and Python PyPI. You can choose any installation source and install on any Linux system with Python 3.

Ubuntu, Linux Mint and other Ubuntu Derivatives

sudo add-apt-repository ppa:slgobinath/safeeyes
sudo apt update
sudo apt install safeeyes

Arch

yay -S safeeyes

Gentoo

sudo emerge -av x11-misc/safeeyes

Debian

sudo apt-get install safeeyes

Fedora

sudo dnf install libappindicator-gtk3 python3-psutil cairo-devel python3-devel gobject-introspection-devel cairo-gobject-devel
sudo pip3 install safeeyes
sudo gtk-update-icon-cache /usr/share/icons/hicolor

OpenSUSE Tumbleweed

sudo zypper refresh
sudo zypper install safeeyes

Alpine Linux

sudo apk add safeeyes

Flatpak

flatpak install flathub io.github.slgobinath.SafeEyes

Other Linux & Run from source

Ensure to meet the following dependencies:

  • gir1.2-appindicator3-0.1 or gir1.2-ayatanaappindicator3-0.1
  • gir1.2-notify-0.7
  • libappindicator-gtk3
  • python3-psutil
  • xprintidle (optional)
  • wlrctl (wayland optional)

To install Safe Eyes:

sudo pip3 install safeeyes

After installation, restart your system to update the icons,

To run from source:

git clone https://github.com/slgobinath/SafeEyes.git
cd SafeEyes
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

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.

  1. Install the necessary dependencies

    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
  2. Create a virtual environment in your home folder

    mkdir ~/safeeyes
    cd ~/safeeyes/
    
    pip3 install virtualenv --user
    virtualenv --no-site-packages venv
    source venv/bin/activate
    pip3 install dbus-python safeeyes
  3. Start Safe Eyes from terminal

    cd ~/safeeyes & source venv/bin/activate
    python3 -m safeeyes

For more details, please check the issue: #329

Features

  • Remind you to take breaks with exercises to reduce RSI
  • Disable keyboard during breaks
  • Notification before and after breaks
  • Smart pause if system is idle
  • Multi-screen support
  • Customizable user interface
  • RPC API to control externally
  • Command-line arguments to control the running instance
  • Customizable using plug-ins

Third-party Plugins

Thirdparty plugins are available at another GitHub repository: safeeyes-plugins. More details about how to write your own plugin and how to install third-party plugin are available there.

How to Release?

  1. Checkout the latest commits from the master branch
  2. Run python3 -m safeeyes to make sure nothing is broken
  3. Update the Safe Eyes version in the following places (Open the project in VSCode and search for the current version):
  4. Update the changelog (for Ubuntu release)
  5. Commit the changes to master
  6. Create a pull-request from master to release
  7. Merge the PR to release with merge commit (Important to merge with merge commit)

License

GNU General Public License v3

IDE Support

Thanks to JetBrains for offering IDE support to develop this Open Source project.

safeeyes's People

Contributors

adamps avatar akronix avatar albanobattistella avatar anprok avatar ao-loclab avatar comradekingu avatar hartwork avatar jalakas avatar jankudrik avatar jessetg avatar jorgesumle avatar jsmakaayb avatar karsibali avatar krotesk avatar lgobinath avatar misaghlb avatar orschiro avatar p-bo avatar porrumentzio avatar radek-sprta avatar reinis avatar ruxlab avatar santossi avatar slgobinath avatar sr093906 avatar vistaus avatar weblate avatar welaq avatar wilmup avatar zypangpang avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

safeeyes's Issues

not working in linux mint 17.3

Indicator is showing up in bottom panel and giving notification before 10 seconds as set in the configuration.After that it is not blocking the screen or doing any thing else.

Sudden crashes with 1.1.7

Dear all,

Can someone else confirm sudden crashes of the latest release 1.1.7?

It seems to happen just before the break starts that it crashes.

However, not on every break.

I will try to see a pattern!

arch-linux black-notification window is not showing up

I think notification-thing-git is a missing dependency for Arch-Linux.

This is the message before I installed notification-thing-git

Exception in thread Thread-6:
Traceback (most recent call last):
File "/usr/lib/python2.7/threading.py", line 801, in __bootstrap_inner
self.run()
File "/usr/lib/python2.7/threading.py", line 754, in run
self.__target(*self.__args, **self.__kwargs)
File "/usr/lib/safeeyes/SafeEyesCore.py", line 204, in __notify_and_start_break
self.show_notification()
File "/usr/bin/safeeyes", line 68, in show_notification
notification.show(config['pre_break_warning_time'])
File "/usr/lib/safeeyes/Notification.py", line 51, in show
self.notification.show()
Error: g-dbus-error-quark: GDBus.Error:org.freedesktop.DBus.Error.ServiceUnknown: The name org.freedesktop.Notifications was not provided by any .service files (2)

After installing notification-thing-git I get this message sometimes, I am not sure when safeeyes crashes:

[xcb] Too much data requested from _XRead
[xcb] This is most likely caused by a broken X extension library
[xcb] Aborting, sorry about that.
python2: xcb_io.c:732: _XRead: Assertion `!xcb_xlib_too_much_data_requested' failed.
[1] 23791 abort (core dumped) safeeyes

Disable button

The "Disable Safeeyes" doesn't always work. I think it fails after suspend.

Application specific exception for do not diturb mode

Let Safe Eyes to show break if the full screen app is in the listed applications.
Sample use case: Alice is a web developer she always work with the browser in full screen mode. If she has added Chrome/Firefox to the allowed to interrupt list, then show the break regardless of the screen state of that application.

Environment locale not respected

My system (Ubuntu 16.10) is configured to use German language. All the applications automatically start using German when I configure this in system settings. However SafeEyes does not automatically start using system locale. I think it is generally available in the environment variable LANGUAGE.

Linux Status Bar Icon

When unpacking tarball and starting SafeEyes from terminal, icon in notification cannot use image specified in created .desktop file (located in /home/[uesrname]/.config/autostart directory). SafeEyes works correctly per user settings but the icon is system default for no icon.

Adding a command to the list of startup commands on login, e.g. safeeyes 1200, the icon appears on restart and use of safeeyes.

Note: I added a desired temperature to login commands list ("safeeyes 1200") and when the command is run on login, the icon successfully appears and safeeyes functions correctly.

OS: Kali Linux (Rolling release v 2016.2) XFCE, Kernel 4.8.0 Debian Jessie
Desktop: xfce v 4.2

Picture[s] adding

this app really help for sure, just one thing, right now i am trying to quit smoking, and focusing on work very much helping, the problem is everytime this app tell me to break, instinctively i will look for cigarettes, so I think, if i could see picture of "NO SMOKING!" or "QUIT SMOKING" or something like that in the screen, that will do help so much.

that's all and thanky very much 👍 keep up the great works

.desktop file not translated

The menu comment is not translated.
IE. adding
Comment[fr]=Protégez vos yeux de la fatigue

is probably enough to translate it to French.

Disable for x hours

Sometimes, I disable safeeyes for some reason, then forget to turn it on later. It would be cool to have a "disable for x hours"/"disable until next suspend cycle".

background non-transparent in Ubuntu MATE 16.04

With last update (1.09 i think) safeeyes black background is not transparent at all (100% black). there is nothing in terminal, and i also havnt change any settings in files.

Its not any major issue, but i assume its not WAI.

User autostart

Instead of creating ~/.config/autostart/safeeyes.desktop, do a symlink to the system .desktop.

Add (optional) postpone button

Preferably one could switch it off and choose for how long to postpone

A default could look like this:

  • Postpone for .. 5 minutes, 15 minutes, 30 minutes

Fails to start in Ubuntu 16.10 with "ImportError: No module named scheduler"

SafeEyes (installed from PPA) fails to start in Ubuntu 16.10, with the following error:

$ /opt/safeeyes/safeeyes/safeeyes
Traceback (most recent call last):
  File "/opt/safeeyes/safeeyes/safeeyes", line 29, in <module>
    from SafeEyesCore import SafeEyesCore
  File "/opt/safeeyes/safeeyes/SafeEyesCore.py", line 22, in <module>
    from apscheduler.scheduler import Scheduler
ImportError: No module named scheduler

Tested on 2 Ubuntu 16.10 machines. python-apscheduler is installed. Also, Ubuntu 16.04 and 14.04 are not affected.

Reset timer on screen locking

It would be great if the application stopped itself when it detects that the screen has been locked and resets the timer when the screen has been unlocked. It would prevent things like unlocking the screen then 2 minutes later having to rest my eyes again.

What do you think?

Remote Monitor/Laptop

I can see that #6 will add multi monitor support and I want to expand that to my laptop which are next to my two monitor. I want some sort of solution what Synergy has, so I could configure a client and server and the server would tell the client that is now a rest time.

Add an alert/sound after break

SafeEyes works really well in my computer. However, (and this might sound stupid) when there's break that involves closing my eyes I'd like to be notified when it finishes.

Error in Kubuntu

After installing Safe Eyes, could not start Safe Eyes.
File "/opt/safeeyes/safeeyes", line 37, in <module> from Notification import Notification File "/opt/safeeyes/Notification.py", line 23, in <module> gi.require_version('Notify', '0.7') File "/usr/lib/python2.7/dist-packages/gi/__init__.py", line 102, in require_version raise ValueError('Namespace %s not available' % namespace) ValueError: Namespace Notify not available

Solution: Add gir1.2-notify-0.7 as a dependency

GTK+ 3.4 support

Is there a way to add support for GTK+ 3.4 ?

Traceback (most recent call last):
  File "/opt/safeeyes/safeeyes", line 152, in <module>
    main()
  File "/opt/safeeyes/safeeyes", line 143, in main
    break_screen = BreakScreen(on_skipped, break_screen_glade, style_sheet_path)
  File "/opt/safeeyes/BreakScreen.py", line 38, in __init__
    builder.add_from_file(glade_file)
  File "/usr/lib/python2.7/dist-packages/gi/types.py", line 43, in function
    return info.invoke(*args, **kwargs)
gi._glib.GError: /opt/safeeyes/glade/break_screen.glade: required gtk+ version 3.10, current version is 3.4

~ $ dpkg -s libgtk-3-0|grep '^Version'
Version: 3.4.2-0ubuntu0.9

Would be nice to see this on pypi

It would be really nice and maybe also more standard and safe to make this installable into the user's home directory with pip install --user safeeyes instead of adding PPAs or un-targzing this into /.
It would also be easier to update (pip install --upgrade --user safeeyes) for people who do not want to add third party PPAs to apply updates as opposed to the tar.gz method.
Just an idea to consider.

Thanks.

ValueError: 'LC_CTYPE=en_US' is not a valid locale identifier

Using the latest SafeEyes 1.1.5 in Ubuntu 16.10, I get the following:

$ /opt/safeeyes/safeeyes
Exception in thread Thread-1:
Traceback (most recent call last):
  File "/usr/lib/python2.7/threading.py", line 801, in __bootstrap_inner
    self.run()
  File "/usr/lib/python2.7/threading.py", line 754, in run
    self.__target(*self.__args, **self.__kwargs)
  File "/opt/safeeyes/SafeEyesCore.py", line 166, in __scheduler_job
    self.update_next_break_info(next_break_time)
  File "/opt/safeeyes/TrayIcon.py", line 160, in next_break_time
    self.set_next_break_info(self.dateTime)
  File "/opt/safeeyes/TrayIcon.py", line 163, in set_next_break_info
    formatted_time = Utility.format_time(dateTime)
  File "/opt/safeeyes/Utility.py", line 109, in format_time
    return babel.dates.format_time(time, format='short', locale=system_locale)
  File "/usr/lib/python2.7/dist-packages/babel/dates.py", line 784, in format_time
    locale = Locale.parse(locale)
  File "/usr/lib/python2.7/dist-packages/babel/core.py", line 270, in parse
    parts = parse_locale(identifier, sep=sep)
  File "/usr/lib/python2.7/dist-packages/babel/core.py", line 1115, in parse_locale
    raise ValueError('%r is not a valid locale identifier' % identifier)
ValueError: 'LC_CTYPE=en_US' is not a valid locale identifier

And while SafeEyes shows up, it doesn't seem to work - no breaks are triggered.

Add support for 20-20-20 rule

The 20-20-20 Rule

Would be nice to support it along the eye yoga exercises. Possible implementations I thought off:

  • A setting to choose between eye yoga and 20-20-20
  • Medium breaks: follow every other short break eye exercise by the 20-20-20 rule
  • Run 20-20-20 on a separate timer in addiction to yoga exercises

Show time until next break

Nice app, I just started using it in elementary OS Freya (64 bit).

It would be nice to see how long it takes until the next break, and a description of what break it will be (short, long, exercise, etc)

It could be located below Quit in the icon's pop-up perhaps?

Translations?

I would like to add multiple languages to this program, but far as I can see only way to do it to change the json file in config. Please make support for the languages 👍

Add 'About' menu

The installed version of the app, and some other important info (like the app's Github site to report issues), are nowhere to be found.

Perhaps they could be added in an 'About' menu in the pop-up.

Support for multiple screens

When multiple screens are connected only active screen (the one mouse is active) gets black out.
You can use the mouse on the other screen (keyboard is disabled in both)

Ubuntu 16.04 with XFCE desktop environment.

Only count time of activity

It happens quite often that I sign in into my computer only to be greeted with „take a walk“ or similar screen after maybe 15 seconds of using it. I guess the app would benefit from ignoring the periods of time which OS considers inactive.

Suspend support

Does SafeEyes correctly handles suspend, like lid switch?

One monitor stays black after overlay is skipped

Hi there, don't know if this was already reported.
On my system (3 monitors where 2 are external 1 is internal) I always experience the problem that after I skip the overlay one of the monitors stays black. It is never the monitor where the skip button is displayed.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.