As of Python 3.12 setuptools is no longer installed by default and
if setuptools is not installed distutils is not found and SafeEyes
fails to start.
Furthermore distutils is deprecated and should thus not be used
anymore. The packaging module provides a replacement for LooseVersion
and it is also recommended by PEP 632 [1].
Also update required Python version for Debian to 3.12 or newer.
[1] https://peps.python.org/pep-0632/#migration-advice
* smartpause: fix calling disable_safeeyes on main thread
by adding missing parameter
This was missed in 903d407faf
* fix forwarding arguments in execute_main_thread
This broke when the first parameter was None, but the second wasn't (the
second parameter wasn't passed at all.)
Use *args/**kwargs to make it behave properly in all cases.
imp is deprecated in 3.4 and removed in 3.12. this caused safe eyes to
break on upgrading to fedora 39
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
* utility: create_startup_entry check link health
* model: init always run create_startup_entry
* utility: initialize_safeeyes don't call create_startup_entry
* utility: add force option to create_startup_entry
* model: do not create autostart, only repair broken
* utility: fix comment
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.