Commit Graph

25 Commits

Author SHA1 Message Date
AdamPS 903d407faf Improvements to "interpret idle as break" #551 2023-11-30 18:04:44 +00:00
AdamPS cbfc0cc133 Local function names should match #550 2023-11-30 14:57:37 +00:00
Ankit Raj Pandey ed60dd1970
Directly track running swayidle process (#470)
We actually don't need to use a separate variable to track the status of
the spawned swayidle process, since we can poll the status directly from
the process object. This increases robustness against e.g. a killed
swayidle process, which would cause safeeyes to be permanently disabled
until a restart.
2021-11-16 08:52:12 -05:00
Ankit Raj Pandey ad041c7855
Add smartpause support for swaywm (#464)
If the current desktop environment is sway, the smartpause plugin will
spawn a swayidle process that outputs the current time on idle and
resume. Using that info, we can determine:

1. Whether the system is currently idle (idle timestamp > active timestamp)
2. How many seconds the system has been idle (current timestamp - idle timestamp)

Since swayidle uses the KDE idle protocol, it might be possible to
extend this to Wayland KDE as well.
2021-09-29 07:53:08 -04:00
Gobinath a69debf8ff Fix next break being postponed forever 2021-01-10 21:32:46 -05:00
Gobinath 25f4aa626f Add cron expression to reset health stats 2020-12-20 10:06:34 -05:00
AdamPS d3bcb9de73
Smart Pause count as long break #373 - correction to original fix (#388)
Co-authored-by: AdamPS <AdamPS@2650563.no-reply.drupal.org>
2020-11-01 20:21:22 -05:00
Gobinath ebe6f1aafb Fix idle start time calculation 2020-10-29 08:49:40 -04:00
Gobinath 2736321048
Reset breaks after being idle longer than a long break duration (#386) 2020-10-25 08:44:29 -04:00
Chris Coutinho 448e11fe7d
Fix UnboundLocalError in smartpause plugin (#378)
* Add UnboundLocalError check in smartpause plugin

Running this package for the first time locally, I see the following error in my gnome logs:

```
Sep 28 10:31:53 x1carbon safeeyes.desktop[13687]: Exception in thread WorkThread:
Sep 28 10:31:53 x1carbon safeeyes.desktop[13687]: Traceback (most recent call last):
Sep 28 10:31:53 x1carbon safeeyes.desktop[13687]:   File "/usr/lib64/python3.8/threading.py", line 932, in _bootstrap_inner
Sep 28 10:31:53 x1carbon safeeyes.desktop[13687]:     self.run()
Sep 28 10:31:53 x1carbon safeeyes.desktop[13687]:   File "/usr/lib64/python3.8/threading.py", line 870, in run
Sep 28 10:31:53 x1carbon safeeyes.desktop[13687]:     self._target(*self._args, **self._kwargs)
Sep 28 10:31:53 x1carbon safeeyes.desktop[13687]:   File "/usr/lib/python3.8/site-packages/safeeyes/plugins/smartpause/plugin.py", line 163, in __start_idle_monitor
Sep 28 10:31:53 x1carbon safeeyes.desktop[13687]:     if next_break is not None:
Sep 28 10:31:53 x1carbon safeeyes.desktop[13687]: UnboundLocalError: local variable next_break referenced before assignment
```

This is a quick fix to solve that error

* Set next_break to None before while loop
2020-10-03 07:58:31 -04:00
Gobinath 0953abe855 Fix the error NoneType added with timedelta 2020-07-08 18:29:36 -04:00
Gobinath 5c554fffc1 Refactor modules and classes 2020-03-18 08:33:11 -04:00
Gobinath 098f320aa1 Optimize smart pause in wayland feature 2019-07-13 22:08:15 -04:00
Filip Kilibarda d4e732a7f0 Added idle time support for gnome/wayland (#332)
* Added idle time support for gnome/wayland

* Removed is_gnome, using Utility.DESKTOP_ENVIRONMENT instead
2019-07-13 19:08:41 -04:00
Gobinath 04a10b17ff Fix bug in removing idle_period from context 2019-02-28 21:15:56 -05:00
Gobinath b08fd0e7a8 Add screen time to health stats 2019-02-24 11:53:20 -05:00
Gobinath 40aacdf642 Allow disabling Safe Eyes option to tray icon. Add #264 2019-02-23 19:14:26 -05:00
Gobinath 107670f9c0
Override break intervals (#294)
* Add break queue

* Add remember last break option

* Add option to override interval

* Increase duration limit for promodo mode
2019-01-11 20:42:51 -05:00
Gobinath 7a22adf91d Add postpone break until system becomes idle 2018-10-31 09:11:25 +05:30
Gobinath 020934aa0f Fix bug in smart pause and release new version 2018-02-09 10:09:08 -05:00
Jalakas 7c0c8c29f3 update estonian language translation, fix some remaining flake8 style fixes (#214)
* flake8 fixes

* translation: update Estonian translation
2017-11-11 10:53:24 -05:00
Gobinath 70759a2115 Add option to interpret system idle as break 2017-10-17 14:50:57 -04:00
Gobinath 8149f331a5 Change the Smart Pause unit to seconds 2017-10-14 09:30:11 -04:00
Gobinath 5aebb3da5d Fix error in upgrading plugins 2017-10-12 09:33:44 -04:00
Gobinath 5de6869309 Safeeyes 2.0.0 (#194) 2017-10-07 09:10:31 -04:00