SafeEyes
SafeEyes copied to clipboard
Broken old autostart link does never get updated if JSON file is present
SafeEyes does not start at startup anymore (so this is a specific case of #367 and #361) when the Python version gets updated and SafeEyes reinstalled. But runs fine every time it gets launched directly. I observed this on Arch Linux installing SafeEyes via Yay + AUR.
To Reproduce Steps to reproduce the behavior:
- Install Python3.9
- Install SafeEyes
- Open SafeEyes
- Make sure that a configuration file has been created in
.config/safeeyes/safeeyes.json. If this file is not present, launchsafeeyes -sand edit random settings. - Upgrade Python3.9 to Python3.10
- Remove SafeEyes and reinstall it, so it moves from 3.9 to 3.10 directory
- Open SafeEyes
The autostart link ~/.config/autostart/safeeyes.desktop still points to /usr/lib/python3.9/site-packages/safeeyes/platform/safeeyes.desktop
Expected behavior
An updated autostart link should be present pointing to /usr/lib/python3.10/site-packages/safeeyes/platform/safeeyes.desktop, allowing SafeEyes to start at every boot.
Analysis
utility.create_startup_entry() gets called by utility.initialize_safeeyes() which gets called by model.Config.__init__ ONLY IF __user_config (the JSON file) is not present.
So, if the JSON file is not present, the link gets updated.
But usually the JSON file is there, so the link does never get updated and remains broken.
Workaround
Open the SafeEyes settings with safeeyes -s and click the weird small button which allows you to reset the configuration and will also force the upgrading of the autostart link.
Desktop (please complete the following information):
- OS: Arch
- Desktop Env: Gnome 41.3
- Version 2.1.3
If the check was on the presence/absence of the link (instead than the JSON file), this issue can be fixed on Arch AUR side (I suppose) having the removal of the package also removing the link with a pre_remove or post_remove instruction in PKGBUILD or simply having the PKGBUILD create (and remove) the link. The current situation is that the autostart link does not get removed and remains as a broken link.
Same problem...
OS: Manjaro (Gnome-wayland) Repo: http://aur.archlinux.org/packages/safeeyes
Any solution?
@bambirombi do you still see this issue on your Manjaro installation? Can you test the code in #531 (I already tested it on my Arch)?
@ilario Now it appears to be working.
Thanks @ilario for your contribution